bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] Rewrite stdbool_.h during build?


From: Paul Eggert
Subject: Re: [Bug-gnulib] Rewrite stdbool_.h during build?
Date: Mon, 26 Apr 2004 16:40:01 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Bruno Haible <bruno@clisp.org> writes:

> The reason is that I plan to install stdbool.h alongside with some libraries
> whose declares functions have 'bool' as argument or return type. I haven't
> done it so far (gettext-po.h has some functions returning 'int' where they
> actually should return 'bool'), but someday I'll do it.
>
> Also it obviates the need for
>      #include "config.h"
> in sources that only include standard header files: <stdio.h>, <stdbool.h>, 
> ...

Are these two separate reasons, or the same reason stated in a
different way?  It appears to me to be the latter (i.e., your other
libraries don't want to include "config.h") but perhaps I'm not
understanding the 1st point.

As far as the 2nd point goes, I had thought that the general rule for
gnulib was that client code was required to include "config.h" before
including any .h file supplied by gnulib.  Historically this was to
support C89 keywords like "const" and "volatile".  Now that we're
assuming C89 or better, it's to support C99 keywords like "restrict".
Such keywords must be defined before any header is included, for
consistency, which is why "config.h" must be included first.

I suppose that we could relax this general rule, by adding an
exception for modules that don't use C99 features.  Is that what
you're thinking of doing?  However, won't the relaxed rule be more
complicated (as stdbool.h will be an exception to the exception
created by this new rule :-)?  It's not clear to me that the extra
complexity is worth it -- but perhaps this is all because I'm not
following your 1st point.




reply via email to

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