Could -Wall add on -Wundef by default ?
Jonathan Wakely
jwakely.gcc@gmail.com
Sat Mar 2 13:46:00 GMT 2019
On Sat, 2 Mar 2019 at 13:42, Jonny Grant wrote:
> >> Perhaps just adding to -Wextra would make sense?
> >
> > I would still be strongly against that. Why can't you just use
> > -Wundef, instead of forcing everybody else to change their code to
> > follow your preferred convention?
>
> Yes, we use it. Presumably someone decided what should go into -Wextra,
> and presumably it is things that are worth adding... in my view it's
> worth adding. No worries if that isn't consensus though! :)
-Wundef is only useful if your code always does:
#if defined(MACRO) && MACRO
instead of just #if MACRO.
They are both perfectly valid ways to write your code. People who are
happy to write the latter should not have to deal with warnings that
are only useful to people who write the former.
More information about the Gcc-help
mailing list