include-file unhappiness

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: include-file unhappiness
Date: 1999-01-04 00:55:12
Message-ID: 20269.915411312@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've been tweaking the current sources to make them compile on HPUX 9
again (right now they don't, for lack of vsnprintf() in libc). All
went well until I tried to get rid of gcc's compile warnings about
lack of a prototype for snprintf & vsnprintf. I put

#ifndef HAVE_SNPRINTF
extern int snprintf(char *str, size_t count, const char *fmt, ...);
#endif

#ifndef HAVE_VSNPRINTF
extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
#endif

into include/c.h (they can't readily go into config.h because config.h
doesn't include any system header that defines size_t or va_list).

That almost works, but there are a few files that blow up because
they include c.h without having included config.h beforehand.

Now I maintain that every file that uses *any* of the Postgres
include files ought to include config.h. Not doing so is a recipe
for trouble as we become more and more dependent on autoconf.
So I propose changing these files to include postgres.h instead of
just including c.h directly:

contrib/fulltextindex/fti.c
src/backend/port/dynloader/aix.c
src/backend/port/dynloader/hpux.c
src/backend/port/dynloader/ultrix4.c
src/backend/storage/buffer/s_lock.c
src/backend/utils/error/format.c
src/backend/utils/mmgr/oset.c
src/backend/utils/mmgr/palloc.c
src/include/libpq/pqcomm.h
src/interfaces/libpq/pqsignal.h

Any objections?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-01-04 03:28:05 Re: [HACKERS] include-file unhappiness
Previous Message Oleg Broytmann 1999-01-03 13:40:10 Re: Date/time fixes for HAVE_TM_ZONE platforms