public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* howto stop gcc to blame: error: ‘no_sanitize’ attribute directive ignored [-Werror=attributes]
@ 2020-07-16  9:30 aotto
  2020-07-16 15:01 ` Martin Sebor
  0 siblings, 1 reply; 2+ messages in thread
From: aotto @ 2020-07-16  9:30 UTC (permalink / raw)
  To: gcc-help

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"

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.


;mf


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: howto stop gcc to blame: error: ‘no_sanitize’ attribute directive ignored [-Werror=attributes]
  2020-07-16  9:30 howto stop gcc to blame: error: ‘no_sanitize’ attribute directive ignored [-Werror=attributes] aotto
@ 2020-07-16 15:01 ` Martin Sebor
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Sebor @ 2020-07-16 15:01 UTC (permalink / raw)
  To: aotto, gcc-help

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-16 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16  9:30 howto stop gcc to blame: error: ‘no_sanitize’ attribute directive ignored [-Werror=attributes] aotto
2020-07-16 15:01 ` Martin Sebor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).