Skip to content

{wiki} AddressSanitizerFlags - show C++ example for __asan_default_options #1610

Open
@asmaloney

Description

@asmaloney

Right now the AddressSanitizerFlags wiki page shows the following code for __asan_default_options:

const char *__asan_default_options() {
  return "verbosity=1:malloc_context_size=20";
}

To use it in C++, however, it needs to be:

extern "C" const char *__asan_default_options() {
  return "verbosity=1:malloc_context_size=20";
}

It a small thing, but it would save people time trying to figure out why it doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions