This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH] Fix assert() warning in gcc < 4.8 [BZ# 21242]


On Tue, 21 Mar 2017, Florian Weimer wrote:

> On 03/19/2017 10:44 PM, Justin Brewer wrote:
> > -# if !defined __GNUC__ || defined __STRICT_ANSI__
> > +# if !(defined __GNUC__ && __GNUC_PREREQ(4,8)) || defined __STRICT_ANSI__
> 
> I'm not happy how this disables the useful = warning for clang altogether.
> 
> Do we have a better option?  Is there a way for check for the -pedantic flag?

By design, warning options such as -pedantic are not meant to affect code 
generation, so should not have any way to check for them within the code.

(Preferably __extension__ should be used, but that runs into the issues 
with disabling it for the user's expression as discussed earlier for this 
code <https://sourceware.org/ml/libc-alpha/2016-11/msg00895.html>.)

-- 
Joseph S. Myers
joseph@codesourcery.com


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