Warnings triggered by recent includefile cleanups

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Warnings triggered by recent includefile cleanups
Дата
Msg-id 13431.963894102@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Warnings triggered by recent includefile cleanups  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: Update: mac.c update, patch now on ftp
Следующее
От: JanWieck@t-online.de (Jan Wieck)
Дата:
Сообщение: Re: TUPLE SIZE HELP