[Top][All Lists]

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

Re: Lists and aliasing (Re: Freeze on 27 February)

From: Lennart Sorensen
Subject: Re: Lists and aliasing (Re: Freeze on 27 February)
Date: Wed, 22 Feb 2012 13:41:04 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Feb 22, 2012 at 01:28:06PM -0500, Lennart Sorensen wrote:
> Oh the feature for doing multiple #pragma statements throughout the code
> is new in gcc 4.6.  It can't be done in earlier versions.  In older
> versions whatever you say last applies to the whole file.
> Perhaps a slightly ugly solution could solve it by having a #if that
> checks that gcc is 4.6 or higher around the #pragma that reenables
> the warning.
> ie:
> #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
> #pragma GCC diagnostic error "-Wunsafe-loop-optimizations"
> #endif
> At least this way you get to have the warning for most of the code on
> newer gcc versions, but don't break older gcc versions that are still
> in common use.

Well it compiles when I do that at least with gcc 4.4, although obviously
it does mean -Wunsafe-loop-optimizations is disabled entirely for those
4 files rather than just for the one function that causes a problem.

Len Sorensen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]