[Bug sanitizer/85556] New: attribute no_sanitize does not accept multiple options as documented

doko at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Apr 28 10:00:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85556

            Bug ID: 85556
           Summary: attribute no_sanitize does not accept multiple options
                    as documented
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

[forwarded from https://bugs.debian.org/891489]

In
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fsanitize-function-attribute
gcc 8.0.1 claims to add a no_sanitize attribute which works the same as
the clang one does.

In practice however it doesn't, and it currently will only accept a
single option.  The example given above is:

  $ cat nosan.c
  void __attribute__ ((no_sanitize ("alignment", "object-size")))
  f () { /* Do something. */; }

  int main(void) { return 0; }


Which results in:

  $ gcc-8 nosan.c 
  nosan.c:3:1: error: wrong number of arguments specified for ‘no_sanitize’
attribute
   f () { /* Do something. */; }
   ^


It would be really nice if that did work as documented, to avoid having
to special case this in user code even more than we already do.


More information about the Gcc-bugs mailing list