[Freeciv-Dev] Re: -ansi -pedantic, was Re: TODO
[Top] [All Lists]
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
Erik Sigra <freeciv@xxxxxxx> wrote:
> Falk Hueffner wrote:
> > Please don't; this is not portable, it's a gcc extension.
> 
> Since I didn't discover this, the flags "-ansi" and "-pedantic" must be
> missing in the Makefiles.
This comes up occasionally.  It turns out that unfortunately there are
problems using -ansi -pedantic by default, though it can be useful to
try (see next post).
The problems are:
- These flags are only useful with gcc (of course), but when we know
  we are using gcc (#if GCC) we sometimes deliberately use gcc-isms.
  In particular, use varargs macro in log.h, which then gives lots of
  warnings.
- Using -ansi changes some pre-defined macros, which can change the
  behaviour of included systems headers.  Eg, under linux I get things
  like:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl  -DDEBUG  -g -Wall -ansi -pedantic 
-c support.c
support.c: In function `mystrcasecmp':
support.c:88: warning: implicit declaration of function `strcasecmp'
- I notice that the --with-included-gettext code fails under --ansi :-(
Also, note that gcc info pages say:
     Some users try to use `-pedantic' to check programs for strict ANSI
     C conformance.  They soon find that it does not do quite what they
     want: it finds some non-ANSI practices, but not all--only those
     for which ANSI C *requires* a diagnostic.
-- David
 
- [Freeciv-Dev] Re: TODO, (continued)
 
- [Freeciv-Dev] Re: TODO, Raimar Falke, 2000/09/22
 
- [Freeciv-Dev] Re: TODO, Daniel Sjölie, 2000/09/22
 
- [Freeciv-Dev] Re: TODO, Gaute B Strokkenes, 2000/09/22
 
- [Freeciv-Dev] Re: TODO, Greg Wooledge, 2000/09/22
 - [Freeciv-Dev] Re: TODO, Gaute B Strokkenes, 2000/09/22
 
- [Freeciv-Dev] Re: TODO, Erik Sigra, 2000/09/22
 - [Freeciv-Dev] Re: -ansi -pedantic, was Re: TODO,
David Pfitzner <=
 
 
[Freeciv-Dev] Re: TODO, David Pfitzner, 2000/09/24
- [Freeciv-Dev] Re: TODO, Thue, 2000/09/24
 
- [Freeciv-Dev] Re: TODO, Erik Sigra, 2000/09/24
 
- [Freeciv-Dev] Re: TODO, Thue, 2000/09/24
- [Freeciv-Dev] Re: TODO, Trent Piepho, 2000/09/24
 - [Freeciv-Dev] Re: TODO, Thue, 2000/09/24
 - [Freeciv-Dev] Re: TODO, Thue, 2000/09/24
 - [Freeciv-Dev] Re: TODO, Thue, 2000/09/24
 - [Freeciv-Dev] Re: TODO, Trent Piepho, 2000/09/24
 
  
- [Freeciv-Dev] Re: TODO, Thue, 2000/09/25
 
 
 
 | 
 |