Re: howto stop gcc to blame: error: ‘no_sanitize’ attribute directive ignored [-Werror=attributes]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/16/20 3:30 AM, aotto wrote:
Hi,

I use sanitizer and switch from "debug" to "release" build but NOW the build is broken with:

.../msgque.h|2993 col 1| error: ‘no_sanitize’ attribute directive ignored [-Werror=attributes]
||  MQ_EXTERN bool MQ_DECL MqEnvCheck(MQ_MNG const mng);
||  ^~~~~~~~~

the code is:

/// check if a \RCAPI{MNG} pointer is a \rcapi{ObjectS}
__attribute__((no_sanitize("address")))
MQ_EXTERN bool MQ_DECL MqEnvCheck(MQ_MNG const mng);

I already tried

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wignored-attributes"

My guess is that the version of GCC you are using doesn't support
the no_sanitize attribute.  I'd try no_sanitize_address to see if
that works.

The message mentions -Werror=attributes so the warning option to
use to control the warning is -Wattributes.


but this does NOT help…

1. have someone the TRICK to silence gcc ONLY for
"__attribute__((no_sanitize("address")))"

2. Why does the warning/error message does NOT include the steps to silence this?
    -> I miss at least the right "diagnostic ignored" argument.

The warnings are not meant to explain how to fix the problems
they point out or suppress the messages.  The former would be
too verbose in most cases and likely incomplete or inapplicable
to some cases, and the latter is documented in general for all
warnings in the manual.

Martin



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux