This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Dealing with warnings & pragma GCC diagnostic in LTO-enabled builds


I wonder why the diagnostics are not simply disabled during LTO. Do
you mean that if you don't use the pragmas you get the warnings twice?

Cheers,

Manuel.

On 21 May 2014 15:53, Emmanuel Blot <eblot.ml@gmail.com> wrote:
> Hi,
>
> I'm having troubles with specifying warnings with LTO-enabled builds:
> Some warnings (-Wstrict-overflow, -Wmaybe-uninitialized, ...) are
> specified on the command line using the -W option switch for compiling
> all files within a project. However on some specific code location,
> I'd like to disable them.
>
> Without LTO mode, "#pragma GCC diagnostic ignored" (along with #pragma
> push & pop) works smoothly.
> However, those pragma declarations seem to be ignored when the
> compiler is invoked back at link stage (LTO build), as if the #pragma
> information was not stored along with the GIMPLE IR.
>
> Is there a workaround, or a better way to disable specific warning in
> specific code locations?
>
> If it matters, I'm using GCC 4.9 with arm-eabi targets, and binutils 2.24
>
> I read the GCC documentation and googled it, but I've not been able to
> find info on this very topic - I may have missed it :-)
>
> Thanks,
> Manu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]