🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #73278

Re: INN 2.4.2 fails to compile with gcc 3.4.2 on Solaris 10

#73278
From: Russ Allbery
Date: Mon, 20 Feb 2006 22:09
64 lines
3920 bytes
In news.software.nntp, Bill Davidsen <davidsen@deathstar.prodigy.com> writes:
> Russ Allbery wrote:
>> In news.software.nntp, Ian Collins <ian-news@hotmail.com> writes:

>>> The comment in the file says:

>>>  * Included for alignment with the ISO/IEC 9899:1999 standard. The
>>>  * contents of this header are only visible when using a c99
>>>  * compiler, otherwise inclusion of this header will result in a
>>>  * forced compilation failure.

>>> gcc isn't a C99 compiler.

>> What the heck was the point of that?

> I thought the comment was pretty clear, the point is to keep you from
> building a non-portable software package. The real question is why that
> header is being included...

For the same reason why I include any other header file:  I want to use
the C language feature defined in that header file.

My guess is that Solaris is trying to protect the user against trying to
use bool with a compiler that doesn't support _Bool, but that's an odd way
of doing it.  Why not just let the compilation fail later?  In this
attempt to protect against an entirely theoretical problem, they've
introduced problems with an actual usage.

I'm sure that the Autoconf 2.59 AC_HEADER_BOOL macro probably handles all
of this, so the real solution would be to just switch Autoconfs.  I'm not
sure I really want to do that for the STABLE branch, though.  (The best
solution would be for me to find the time to get 2.5.0 released.)

> If gcc lacks a c99 environment switch (haven't looked at the new
> features)

It has one, but setting standards environments in gcc is always
problematic since it usually enables standards namespaces and other
undesirable features.  Then you get lost in a twisty little maze of
feature test macros, none of which work quite right.

> then the best thing is to not try to use the feature,

No, INN uses bool extensively and I'm not going to stop.  The general
development philosophy of INN is to use the latest standard and then patch
things up for older standards via Autoconf, and that generally works quite
well.

> and the easy thing is to get a copy of the header and add a -I to
> include that instead of the system header.

Um, no.  That's a really bad idea.

I suppose I need to write an Autoconf probe that does more than just test
for the existence of the header file.  Or switch Autoconf implementations.
Bleh.  I suppose I could just copy the AC_HEADER_BOOL macro from a later
Autoconf.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <871wxxbs29.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.solaris.mbox.zip!g2news1.google.com!news2.google.com!news4.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
References: <slrndvdg03.44o.ese002@spica.exile.org> <87y809qiht.fsf@windlord.stanford.edu> <1140250253.11999@drone2-svc-skyt.qsi.net.nz> <87mzgpqdad.fsf@windlord.stanford.edu> <jTqKf.1717$%m4.316@newssvr33.news.prodigy.com>

Show Full Headers
Complete Article Headers
Message-ID: <871wxxbs29.fsf@windlord.stanford.edu>
Subject: Re: INN 2.4.2 fails to compile with gcc 3.4.2 on Solaris 10
Date: Mon, 20 Feb 2006 14:09:50 -0800
From: Russ Allbery <rra@stanford.edu>
References: <slrndvdg03.44o.ese002@spica.exile.org> <87y809qiht.fsf@windlord.stanford.edu> <1140250253.11999@drone2-svc-skyt.qsi.net.nz> <87mzgpqdad.fsf@windlord.stanford.edu> <jTqKf.1717$%m4.316@newssvr33.news.prodigy.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.solaris.mbox.zip!g2news1.google.com!news2.google.com!news4.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
Newsgroups: news.software.nntp,comp.unix.solaris
Organization: The Eyrie
Lines: 63
NNTP-Posting-Host: windlord.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1140473391 21558 171.64.19.147 (20 Feb 2006 22:09:51 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.18 (linux)
Cancel-Lock: sha1:EWXhYdKyFVL5tojjIrkBu9dfN9k=