Complete.Org: Mailing Lists: Archives: freeciv-dev: June 1999:
Re: [Freeciv-Dev] Programing style
Home

Re: [Freeciv-Dev] Programing style

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Cc: schaefer@xxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Programing style
From: Jules Bean <jmlb2@xxxxxxxxxxxxxxxx>
Date: Thu, 10 Jun 1999 11:01:14 +0100

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.          |
\----------------------------------------------------------------------/

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