Re: compile warnings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: compile warnings
Date
Msg-id 3826.1056557715@sss.pgh.pa.us
Whole thread Raw
In response to Re: compile warnings  (Michael Meskes <meskes@postgresql.org>)
List pgsql-hackers
Michael Meskes <meskes@postgresql.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: Alterplpgsql's lexer so that yylineno and yymore are not
used. Thisavoids 'input buffer overflow' failure on long literals, improvesperformance, gives the right answer for line
positionin functionscontaining multiline literals, suppresses annoying compilerwarnings, and generally is so much
betterI wonder why we didn't doit before.
 

        regards, tom lane


pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: ECPG compile error
Next
From: Rod Taylor
Date:
Subject: Re: ECPG compile error