This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: -Wall by default
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: gcc at gcc dot gnu dot org
- Cc: law at redhat dot com, gdr at integrable-solutions dot net
- Date: Wed, 04 Apr 2012 20:34:38 +0200
- Subject: Re: RFC: -Wall by default
> >> We do have regular requests for this, so it is not just out of thin
> >> air.
> >
> > Perhaps, but I think that changing the default like this is far too
> > invasive. ?GCC should do what it's told, if a user asks for warnings,
> > give them, if they don't, then don't.
>
> It is hard to define "what it is told" means -- we are already in gray
> zone.
>
> > I suspect changing the default like this will generate a flood of
> > complaints.
>
> Really? Such as what?
At least me!-(how many "regular requests" compared to the number of gcc
users?).
> If we get floods of complaints, that can only that -Wall too many
> false positives;
> but I don't think it does. We have been careful over the years to
> watch for that effect.
[macbook] gcc/work% grep ATTRIBUTE_UNUSED gcc/*.c | wc -l
1060
[macbook] gcc/work% grep ATTRIBUTE_UNUSED gcc/*.h | wc -l
21
Doesn't that count as "false positives"? While -Wunused can help to spot
some "copy&paste" errors, most of the time the warning just reflects some
harmless sloppyness.
IMO only the warnings in C that are likely errors should be the default as
it is in gfortran (don't ask for examples of such warnings for C, I am
quasi-illiterate).
Dominique
PS -Wall is a simple enough option to be remembered by all users who need
it (if they don't use it, they don't want it).