Re: compile warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: Joe Conway <mail(at)joeconway(dot)com>, "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: compile warnings
Date: 2003-06-25 16:15:15
Message-ID: 3826.1056557715@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Meskes <meskes(at)postgresql(dot)org> writes:
> This is strange. According to my man page snprintf is declared in
> stdio.h which indeed is included. Where does HP-UX declare snprintf?

It doesn't. Were you including our standard config headers, you'd get
our standard workarounds for missing declarations. Since you are
not, you are *on your own* to deal with all of the same portability
issues that we've so painfully resolved over the years. Does that sound
like a good plan to you?

>> This happens because the ecpg versions of these files ignore the
>> Postgres convention that everything should include postgres.h or
>> postgres_fe.h first.

> pgtypes is supposed to live alone and outside of postgresql.

More so than, say, libpq? I don't think this is a real good idea at
all.

> As for yylineno, it is used in ecpg, yes. Does anyone know how to get
> rid of it and still get the correct line number?

You could roll your own, the way plpgsql's lexer now does. I know it
sounds like a pain, but it really does fix a number of problems (I think
the specific thing that persuaded me to do it in plpgsql was to keep the
lexer from failing on very long string constants). Check CVS to see
what I did in this patch:

2003-05-05 12:46 tgl

* src/pl/plpgsql/src/: gram.y, pl_comp.c, plpgsql.h, scan.l: Alter
plpgsql's lexer so that yylineno and yymore are not used. This
avoids 'input buffer overflow' failure on long literals, improves
performance, gives the right answer for line position in functions
containing multiline literals, suppresses annoying compiler
warnings, and generally is so much better I wonder why we didn't do
it before.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2003-06-25 16:17:16 Re: ECPG compile error
Previous Message Fernando Schapachnik 2003-06-25 16:13:14 Re: Physical Database Configuration