Article View: news.software.nntp
Article #19993Re: Compile options for gcc with SNPRINTF_CFLAGS for Solaris
From: USENET news
Date: Thu, 31 Jul 1997 00:00
Date: Thu, 31 Jul 1997 00:00
67 lines
3492 bytes
3492 bytes
In article <5rold8$rrs@solaris.cna.tek.com>,
Frank 'Scruffy' Miller <frankm@solaris.cna.tek.com> wrote:
>In article <5rnpbu$hgq@solaris.cna.tek.com>,
>Frank 'Scruffy' Miller <frankm@solaris.cna.tek.com> wrote:
>>Was doing an upgrade from 1.5.1 to 1.5.1sec with standard working hours
>>to 1am when I ran into compile errors for gcc 2.7.2.2 for libsnprintf.a
>>for Solaris 2.5.1. Has anyone the gcc compile flags out?
>
>Okay, was able to spend 15 this afternoon on this:
>
>With gcc an Solris 2.5* on 1.5.1sec I used for SNPRINTF_CFLAGS:
>
> -Dsun -D__svr4__
>
>I disagree with -DBad_float_h as recommended because float.h contains:
>
> DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
> FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
The comments in config.data say "with the Sun C compiler" for a good reason;
the suggested SNPRINTF_CFLAGS there are for Solaris 2.5* with Sun's
compiler, *not* with GCC.
The comments from the Makefile in the newlog package (included in full in
INN 1.6b1/2, but with only the necessary bits extracted for 1.5.1sec) say
# Define BAD_FLOAT if you are unfortunate enough to not use
# gcc and thus don't have a proper float.h
#
BAD_FLOAT = -DBad_float_h
No indication of what is or may be inadequate with non-GCC-fixed headers...
Assuming the comment is correct (on all platforms...?), you should NOT
use -DBad_float_h with GCC (whereas empirically it is essential on Solaris
2.5[.1] with Sun's C compiler). [With the proviso that it may be misleading,
that comment from the original Makefile probably ought to be included in the
INN config.data comments...]
From discussion of 1.6b1/2, the -Dsun -D__svr4__ should not be needed with
GCC (it defines them...) - but again, are needed with Sun's compiler because
the newlog code is reliant on GCC-specific features. (Apparently there are
equivalent symbols defined by *both* compilers, which could have been used
instead and would have avoided extra definitions being needed with either
compiler).
NB I have only used Sun's compilers, so I'm relying on untested information
for GCC.
>
>Also, in vfprintf <math.h> is not needed as things are defined in
>the local xstdio.h. So I changed vfprintf.c to only include
><math.h> if it is not a sun:
What xstdio.h is that? I don't see it either in Sun-supplied form or as a
GCC-invented addition on my Solaris 2.5.1 system!
Overall, the snprintf stuff looks like it could have been much more
portable, or at least need less system-specific special-casing. However,
unless/until it is cleaned up, we just have to cope with its idiosyncracies.
John Line
--
Cambridge University Computing Service - USENET news manager. Usually John Line
newsmaster@ucs.cam.ac.uk (alias {newsmaster,news,usenet}@news.cam.ac.uk)
Technical Details
Message-ID:
<5rprp1$rqi@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-mailReferences:
<5rnpbu$hgq@solaris.cna.tek.com> <5rold8$rrs@solaris.cna.tek.com>Show Full Headers
Complete Article Headers
Message-ID: <5rprp1$rqi@lyra.csx.cam.ac.uk> Subject: Re: Compile options for gcc with SNPRINTF_CFLAGS for Solaris Date: Thu, 31 Jul 1997 00:00:00 +0000 From: news@news.cam.ac.uk (USENET news) References: <5rnpbu$hgq@solaris.cna.tek.com> <5rold8$rrs@solaris.cna.tek.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 X-Deja-AN: 260913702 Distribution: inet Organization: Computing Service, Cambridge University, England Newsgroups: news.software.nntp