Re: Row pattern recognition - Mailing list pgsql-hackers

From 신성준
Subject Re: Row pattern recognition
Date
Msg-id CACdN0M4D8B4YqNS1rRE24usH_Rm5p-YYjKhWGXNMCgHEu6+Mng@mail.gmail.com
Whole thread
In response to Re: Row pattern recognition  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: Row pattern recognition
List pgsql-hackers
Hi Tatsuo,

> In addition you see #define INITIAL in gram.h?

Yes -- here gram.h has both the enum and the macro:

    enum yytokentype { ...; INITIAL = 472; ... };
    #define INITIAL 472

The file header says "made by GNU Bison 2.3". That's macOS's system
bison, and it still emits the #define token macros, so INITIAL collides
with flex's #define INITIAL 0 in the scanner. Your 3.8.2 emits only the
enum, which is why you don't see it. 2.3 is the minimum the tree still
accepts (meson.build asks for >= 2.3) and it's what macOS ships, so a
build on that floor hits the warning.

> probably we should consider change "INITIAL" to something like
> "INITIAL_P" to avoid the collision?

That matches the _P convention already used for NULL_P / TRUE_P / IN_P,
so it seemed worth trying. I've attached a small patch that renames the
token to INITIAL_P in kwlist.h and gram.y; the SQL keyword stays
"initial". With it applied, both -Wmacro-redefined warnings are gone and
the build is warning-clean here, still on bison 2.3. The patch is on top
of v49 and named nocfbot-*.txt so cfbot doesn't pick it up. No rush on
this -- it can wait for whenever a cleanup pass fits. Please fold it in
or adjust as you see fit.

Regards,
Seongjun

Attachment

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: Checkpointer write combining
Next
From: Tatsuo Ishii
Date:
Subject: Re: Row pattern recognition