christophercrouzet / rexo

Neat single-file cross-platform unit testing framework for C/C++.
The Unlicense
28 stars 6 forks source link

Disable asan in data sections only for Clang #19

Closed christophercrouzet closed 1 year ago

christophercrouzet commented 2 years ago

Some compilers like GCC don't know about the attribute no_sanitize_address, which is causing ton of compiler warnings.

Thanks to @default-writer for pointing this out!

default-writer commented 1 year ago

@christophercrouzet for some reason, I found a workaround to disable asan in code:

const char* __asan_default_options() { return "detect_leaks=0"; }

so i think i just had misconfigured CMakeListst.txt, so, generally, default setting could be overriten almost for anything, i hope so!

default-writer commented 1 year ago

i will delete and reactivate the rexo as a submodule for my c repo, thanks!

default-writer commented 1 year ago

I also found that changing RX_REQIRE (from backlog versio 0.2.3 or so) to RX_ASSERT will remove all warnings, on branch o-asan

image

default-writer commented 1 year ago

@christophercrouzet all worked like a charm on no-asan brunch, thanks

default-writer commented 1 year ago

currently on main:

image

currently, on no-asan (fixed):

image

christophercrouzet commented 1 year ago

Glad to hear, thanks for letting me know @default-writer! :blush: