pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
base_yylex undefined in src/interface/ecpg/preproc/parser.c
4+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2016-12-11 7192865bdc 73ae395d84 4262c5b1ee 329361cfa3  Build backend/parser/scan.l and interfaces/ecpg/preproc/pgc.l standalone.
  2016-12-11 89d1dfa49a 92fb649837 2d48131ed1 15b3722700 fb12471ebe 2bdee07abe  Use "%option prefix" to set API names in ecpg's lexer.
* base_yylex undefined in src/interface/ecpg/preproc/parser.c
@ 2016-12-11 16:49  Дилян Палаузов <dpa-postgres@aegee.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Дилян Палаузов @ 2016-12-11 16:49 UTC (permalink / raw)
  To: pgsql-bugs

Hello,

with the newest flex (v2.6.2-19-g6bea32e, which is newer than 2.6.3) I 
need this patch to compile postgres:

diff --git a/src/interfaces/ecpg/preproc/pgc.l 
b/src/interfaces/ecpg/preproc/pgc.l
index 0453409d37..1c82b58e18 100644
inline patch 1: src/interfaces/ecpg/preproc/pgc.l (+0/-0 lines) download inline-1.patch--- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -30,7 +30,7 @@ static int xcdepth = 0; /* depth of
nesting in slash-star comments */ static char *dolqstart = NULL; /* current $foo$ quote start string */ static YY_BUFFER_STATE scanbufhandle; static char *scanbuf; - +#define yylex base_yylex /* * literalbuf is used to accumulate literal values when multiple rules * are needed to parse a single literal. Call startlit to reset buffer otherwise the linker fails with: gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O0 -pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DECPG_COMPILE -L../../../../src/port -L../../../../src/common -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -Wl,--as-needed -Wl,-rpath,'/usr/local/lib',--enable-new-dtags preproc.o type.o ecpg.o output.o parser.o keywords.o c_keywords.o ecpg_keywords.o kwlookup.o ../ecpglib/typename.o descriptor.o variable.o -lpgcommon -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lrt -lcrypt -ldl -lm -lpthread -o ecpg parser.o: In function `filtered_base_yylex': /git/postgresql/src/interfaces/ecpg/preproc/parser.c:68: undefined reference to `base_yylex' /git/postgresql/src/interfaces/ecpg/preproc/parser.c:105: undefined reference to `base_yylex' collect2: error: ld returned 1 exit status make: *** [Makefile:42: ecpg] Error 1 because of ecpg/preproc/parser.c:68 (in REL9_5_STABLE) With previous versions of flex the compilation has worked. But I do not find in the code where is supposed yylex to be renamed to base_yylex when parser.c is proccessed. pgc.l also does not use %option prefix=base_yy, which would be the right way to rename yylex (apart from #define YY_DECL). What is the purpose to rename yylex to base_yylex? Greetings Дилян -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs ^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: base_yylex undefined in src/interface/ecpg/preproc/parser.c
@ 2016-12-11 18:32  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Дилян Палаузов <dpa-postgres@aegee.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2016-12-11 18:32 UTC (permalink / raw)
  To: Дилян Палаузов <dpa-postgres@aegee.org>; +Cc: pgsql-bugs

=?UTF-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= <dpa-postgres@aegee.org> writes:
> with the newest flex (v2.6.2-19-g6bea32e, which is newer than 2.6.3) I 
> need this patch to compile postgres:

Ugh.

> With previous versions of flex the compilation has worked.  But I do not 
> find in the code where is supposed yylex to be renamed to base_yylex 
> when parser.c is proccessed.  pgc.l also does not use %option 
> prefix=base_yy, which would be the right way to rename yylex (apart from 
> #define YY_DECL).
> What is the purpose to rename yylex to base_yylex?

It's mostly for consistency with the backend, where we have multiple bison
parsers (and multiple flex lexers) so there's a policy of renaming all of
them away from the default name.  Since ecpg is a standalone program,
we could in principle not bother to rename its parser; but I'd rather
keep it in as close sync with the corresponding backend code as possible.

The reason for the current hacky approach is explained in pgc.l:

/*
 * Change symbol names as expected by preproc.y.  It'd be better to do this
 * with %option prefix="base_yy", but that affects some other names that
 * various files expect *not* to be prefixed with "base_".  Cleaning it up
 * is not worth the trouble right now.
 */
#define yylex           base_yylex
#define yylval          base_yylval

Looks like it's time to pay down that technical debt.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: base_yylex undefined in src/interface/ecpg/preproc/parser.c
@ 2016-12-11 20:04  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2016-12-11 20:04 UTC (permalink / raw)
  To: Дилян Палаузов <dpa-postgres@aegee.org>; +Cc: pgsql-bugs

I wrote:
> Looks like it's time to pay down that technical debt.

Patch pushed --- could you confirm things work with that new flex version?

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: base_yylex undefined in src/interface/ecpg/preproc/parser.c
@ 2016-12-11 20:37  Дилян Палаузов <dpa-postgres@aegee.org>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Дилян Палаузов @ 2016-12-11 20:37 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

Hello Tom,

it compiles with flex v2.6.2-19-g6bea32e (which is the newest one, as 
there is no flex 2.6.3).

Greetings
   Дилян

On 12/11/2016 09:04 PM, Tom Lane wrote:
> I wrote:
>> Looks like it's time to pay down that technical debt.
>
> Patch pushed --- could you confirm things work with that new flex version?
>
> 			regards, tom lane
>


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-12-11 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-12-11 16:49 base_yylex undefined in src/interface/ecpg/preproc/parser.c Дилян Палаузов <dpa-postgres@aegee.org>
2016-12-11 18:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-12-11 20:04   ` Tom Lane <tgl@sss.pgh.pa.us>
2016-12-11 20:37     ` Дилян Палаузов <dpa-postgres@aegee.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox