Warnings triggered by recent includefile cleanups - Mailing list pgsql-hackers

From Tom Lane
Subject Warnings triggered by recent includefile cleanups
Date
Msg-id 13431.963894102@sss.pgh.pa.us
Whole thread Raw
Responses Re: Warnings triggered by recent includefile cleanups  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
For the last week or so I've been getting warnings like this:

gcc -c  -I../../../../src/include  -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -g -O1 -MMD float.c -o
float.o
In file included from float.c:58:
/usr/include/values.h:27: warning: `MAXINT' redefined
/usr/local/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.2/include/sys/param.h:46: warning: this is the location of the
previousdefinition
 

in half a dozen backend files.  On investigation I find that the cause
is this recent change:
-#ifdef HAVE_LIMITS_H#include <limits.h>
-#ifndef MAXINT
-#define MAXINT           INT_MAX
-#endif
-#else#ifdef HAVE_VALUES_H#include <values.h>
-#endif#endif

specifically the fact that the code now tries to include *both*
<limits.h> and <values.h> rather than only one.  Well, I'm here
to tell you that the two headers are not entirely compatible,
at least not on this platform (HPUX 10.20, obviously).

Checking the CVS logs, I see that 7.0 is our first release that tries
to include <values.h> at all, so we have little track experience with
that header and none with its possible conflicts with the ANSI-standard
headers.  The submitter of the patch that added it did not recommend
including it unconditionally, but only if <limits.h> is not available.
Looks like he knew what he was doing.

Does anyone object if I revert this code to the way it was?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Update: mac.c update, patch now on ftp
Next
From: JanWieck@t-online.de (Jan Wieck)
Date:
Subject: Re: TUPLE SIZE HELP