[cfe-dev] more --sanitize= flags

Matthieu Monrocq matthieu.monrocq at gmail.com
Tue Nov 6 11:15:23 PST 2012

On Tue, Nov 6, 2012 at 7:53 PM, Kostya Serebryany <kcc at google.com> wrote:

> Hi,
> We need more clang flags in two categories:
>    - flags that modify the behavior of asan/tsan/msan
>    - flags that enable additional features of asan/tsan/msan
> As we just discussed with Richard Smith, the flags should probably look
> like this:
> modify the behavior:
>    -f[no-]sanitize-address-zero-base-shadow # zero base for asan, should
> check that -pie is present, linux-only
>    -f[no-]sanitize-memory-track-origins  # msan track-origins (once msan
> is in trunk, of course)
> add additional features:
>   -fsanitize=address,global-init-order,use-after-return,use-after-scope #
> asan subphases, currently off by default.
> Does that sound good? Anything else?
> Thanks,
> --kcc
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
It seems weird to me, as a user, than the syntax to modify behavior would
not reuse the "-fsanitize" common prefix.

There is precedent in -Wl being able to forward parameters to the linker
already, so maybe a dedicated "-fsanitize-flags=address,....." could just
forward the flags (whatever they are) to ASan and let it parse them. If the
commas pose an issue, then perhaps than a "-fsanitize-address flag" would
be simpler, with the latter part (address) being taken from the list of
known checkers.

-- Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121106/a5f404be/attachment.html>

More information about the cfe-dev mailing list