master, static inline and #ifndef FRONTEND

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org, Dave Page <dpage(at)pgadmin(dot)org>
Subject: master, static inline and #ifndef FRONTEND
Date: 2018-08-24 15:42:37
Message-ID: 20180824154237.mabsv6fsz5q37bma@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hi,

In a recent commit [1] I added a static inline which castoroides
dislikes:
cc -D_STDC_C99= -Xa -g -m64 -xarch=native -xdepend -xO4 -xprefetch=auto,explicit pg_waldump.o compat.o xlogreader.o rmgrdesc.o brindesc.o clogdesc.o committsdesc.o dbasedesc.o genericdesc.o gindesc.o gistdesc.o hashdesc.o heapdesc.o logicalmsgdesc.o mxactdesc.o nbtdesc.o relmapdesc.o replorigindesc.o seqdesc.o smgrdesc.o spgdesc.o standbydesc.o tblspcdesc.o xactdesc.o xlogdesc.o -L../../../src/port -L../../../src/common -Wl,-R'/export/home/dpage/pgbuildfarm/castoroides/HEAD/inst/lib' -lpgcommon -lpgport -lpam -lgss -lz -lnsl -lrt -lsocket -lm -o pg_waldump
Undefined first referenced
symbol in file
slot_getsomeattrs rmgrdesc.o

So it's the "old" issue of static inlines referencing functions that
aren't present, which newer compilers don't have.

It's obviously trivial to fix this case with by adding an #ifndef
FRONTEND. But as castoroides appears to be the only animal showing the
problem - after subtracting the animals dead due to the C99 requirement
- I wonder if we shouldn't just require "proper" static inline
support. castoroides runs a 13yo OS, and newer compilers that do not
have the problem are readily available.

I think it's very likely that we'll add more and more static inlines,
and having to either experimentally check via the buildfarm, or just add
#ifndef FRONTEND everywhere is pretty annoying.

Greetings,

Andres Freund

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=88ebd62fcc2ea7c55c0858f6dd4800d51383529f
[2] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=castoroides&dt=2018-08-24%2012%3A03%3A05

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-08-24 15:46:23 Re: Windows vs C99 (was Re: C99 compliance for src/port/snprintf.c)
Previous Message Konstantin Knizhnik 2018-08-24 15:36:52 Re: [HACKERS] Cached plans and statement generalization