Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2002:
[Freeciv-Dev] Re: gcc poisoning
Home

[Freeciv-Dev] Re: gcc poisoning

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: gcc poisoning
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Thu, 24 Oct 2002 22:19:08 +0000 (GMT)

On Thu, 24 Oct 2002, Raimar Falke wrote:
> > So basically I want you to chime in if you think gcc poisoning is
> > something worth putting in, and then I'll do the required autoconf work.
>
> Why autoconf work?
...
> > +/* Poison functions to prevent them from being used (portability) */
> > +#pragma GCC poison snprintf vsnprintf strcasecmp strncasecmp usleep
> > +#pragma GCC poison strerror gethostname
>
> What does an old gcc thinks about these?

Old gcc gives warnings whenever shared.h is included, which is very, very
often. That is very, very many warnings... so unless there is a way to
#ifdef this using some gcc macro magic, we will have to use autoconf.

> > -#include "shared.h"                /* bool type and fc__attribute */
> > +/* Want to use GCC's __attribute__ keyword to check variadic
> > + * parameters to printf-like functions, without upsetting other
> >+ * compilers: put any required defines magic here.
> > + * If other compilers have something equivalent, could also
> > + * work that out here. Should this use configure stuff somehow?
> > + * --dwp
> > + */
> > +#if defined(__GNUC__)
> > +#define fc__attribute(x)__attribute__(x)
> > +#else
> > +#define fc__attribute(x)
> > +#endif
> > +
> > +typedef int bool;
>
> Here were are in a philosophical discussion whether these are features
> which we are missing on some systems (support) or freeciv-specific
> features (shared).

Andy Black posted a patch which ifdef'ed out the bool typedef on MacOSX
systems. This would also be the case for other non-gcc C99 systems. So
clearly bool is a feature we use that is missing on some systems.
fc__attribute is more of a gray zone, but I had to move it there since it
is used in support.h and support.h can't include shared.h and its pragmas.

  - Per



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