🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #19623

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)

#19623
From: Casper H.S. Dik - Network Securi...
Date: Thu, 24 Jul 1997 00:00
58 lines
3027 bytes
news@news.cam.ac.uk (USENET news) writes:

>On Solaris 2.5.1 with Sun's C compiler (V4.0), the recipe which I found to
>work was

>(a) Enable the assignment "BAD_FLOAT = -DBad_float_h" (near the top of the 
>newlog Makefile) by removing the "#" comment character.

What does this do?

>(b) Add " -Dsun -D__svr4__ -Xc" to the "live" CFLAGS line (not the 
>commented-out alternative one) in Makefile.

Why do they need this?

Gcc uses __svr4__ && __SVR4; Sun's compiler's use __SVR4.  Why not
use __SVR4?

Why -Xc?  That tells the include files not to include anything that's
not standard conformant. (i.e., anything that conflicts with the
user defined namespace).  Do they need to have __STDC__ defined as 1?
(Which should mean obsolute standard conformance; but gcc maintainers
feel you can defined __STDC__ as 1 w/o being standard conformant; and
have invented __STRICT_ANSI__ for that purpose.  Kinda defeats the
reason of having standards in the first place)

>but nothing would get logged by INN via syslog. It provides a replacement
>syslog() which will truncate the logged message if necessary - with an
>indication that it's happened - but without the magic noted above, syslogd
>wouldn't recognise those messages (or something...).

You dont' need that in Solaris; it's syslog will truncate such messages.

>in Makefile implies that float.h is *always* broken if you aren't using gcc 
>(and hence is right if using gcc :-); that seems far-fetched, but
>un-commenting the line did make things work with Sun's cc, even though it
>compiled OK (but didn't work) without. (b) is needed because Sun's cc
>defines different preprocessor symbols to indicate you're on Sun hardware
>and SVR4, and its default mode (ANSI C plus Sun extensions) does not set
>_STDC_, which you get only if you specify strict ANSI C compliance with -Xc


Actually, it sets __STDC__ as 0.  And you'd perhaps want
-Xc -D__EXTENSIONS__ instead. (__STDC__ as 1 but w/ the extensions)


Beats me why they think float.h is bad.


Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Technical Details
Message-ID: <casper.869756597@uk-usenet.uk.sun.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <33D4F714.41C6@rediris.es> <33d4fff4.586615989@nntp.uunet.ca> <5r7gf7$knm@lyra.csx.cam.ac.uk>

Show Full Headers
Complete Article Headers
Message-ID: <casper.869756597@uk-usenet.uk.sun.com>
Subject: Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
Date: Thu, 24 Jul 1997 00:00:00 +0000
From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
References: <33D4F714.41C6@rediris.es> <33d4fff4.586615989@nntp.uunet.ca> <5r7gf7$knm@lyra.csx.cam.ac.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 258609998
Supersedes: <cancel.casper.869756597@uk-usenet.uk.sun.com>
Organization: Sun Microsystems, Netherlands
Newsgroups: news.software.nntp