Re: [Freeciv-Dev] Programing style
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
David Pfitzner wrote:
> > gcc -Wmissing-prototypes -pedantic -DHAVE_CONFIG_H -I. -I. -I.. -g -O2
> > -Wall -c unit.c
> > In file included from unit.c:23:
> > unit.c: In function `best_role_unit':
> > unit.c:1128: warning: `u' might be used uninitialized in this function
>
> This is an interesting one, which I've noticed before. The warning
> doesn't make sense looking at the code, it goes away if you turn
> off -O2, and it didn't occur with older version of gcc. Seems like
> a gcc bug to me. I did actually isolate a small program which
> reproduces the warning, but then didn't get around to doing anything
> about it.
>
> So does anyone want to work out whether there any _useful_
> warnings of missing prototypes in that huge amount of output?
-pedantic isn't generally very useful. If I were you, I'd simply use
-Wmissing-prototypes.
If you *want* lots of warnings, -Wall is still a better idea than
-pedantic.
Jules
--
/----------------+-------------------------------+---------------------\
| Jelibean aka | jules@xxxxxxxxxxxxxxx | 6 Evelyn Rd |
| Jules aka | | Richmond, Surrey |
| Julian Bean | jmlb2@xxxxxxxxxxxxxxxx | TW9 2TF *UK* |
+----------------+-------------------------------+---------------------+
| War doesn't demonstrate who's right... just who's left. |
| When privacy is outlawed... only the outlaws have privacy. |
\----------------------------------------------------------------------/
|
|