Thread: warning: HS_KEY redefined (9.5 beta2)

warning: HS_KEY redefined (9.5 beta2)

From
Mike Blackwell
Date:

Still seems broken, at least for me.

Built with Perl 5.22.
uname -m = x86_64
uname -r = 2.6.32-504.12.2.el6.x86_64

__________________________________________________________________________________
Mike Blackwell | Technical Analyst, Distribution Services/Rollout Management | RR Donnelley
1750 Wallace Ave | St Charles, IL 60174-3401
Office: 630.313.7818
Mike.Blackwell@rrd.com
http://www.rrdonnelley.com


Re: warning: HS_KEY redefined (9.5 beta2)

From
Erik Rijkers
Date:
On 2015-11-19 01:55, Mike Blackwell wrote:
> Google says this was present in beta1. (
> http://www.postgresql.org/message-id/5596A162.30701@dunslane.net)
> 
> Still seems broken, at least for me.
> 
> Built with Perl 5.22.
> uname -m = x86_64
> uname -r = 2.6.32-504.12.2.el6.x86_64
> 

FWIW: Here, Centos 6.6 with gcc 4.4.7 compiles more or less silently 
(emits only the usual scan.c warning).

The same system with gcc 5.2.0 yields a number of warnings:


./configure \  --prefix=/home/aardvark/pg_stuff/pg_installations/pgsql.REL9_5_STABLE 
\  
--bindir=/home/aardvark/pg_stuff/pg_installations/pgsql.REL9_5_STABLE/bin 
\  
--libdir=/home/aardvark/pg_stuff/pg_installations/pgsql.REL9_5_STABLE/lib 
\  --with-pgport=6545 --quiet --enable-depend --enable-cassert 
--enable-debug \  --with-extra-version=_REL9_5_STABLE_20151119_0914_f11c557e92c5 
--with-openssl \  --with-perl --with-libxml --with-libxslt --with-zlib 
--enable-tap-tests


make core: make --quiet -j 8
In file included from gram.y:14861:0:
scan.c: In function ‘yy_try_NUL_trans’:
scan.c:10307:23: warning: unused variable ‘yyg’ [-Wunused-variable]     struct yyguts_t * yyg = (struct
yyguts_t*)yyscanner;/* This var 
 
may be unused depending upon options. */                       ^
In file included from ../../../src/include/postgres.h:48:0,                 from plperl.c:8:
plperl.c: In function ‘select_perl_context’:
../../../src/include/utils/elog.h:41:16: warning: passing argument 1 of 
‘errmsg’ makes pointer from integer without a cast [-Wint-conversion] #define ERROR  20   /* user error - abort
transaction;return to                ^
 
plperl.c:643:10: note: in expansion of macro ‘ERROR’   errmsg(ERROR,          ^
In file included from ../../../src/include/postgres.h:48:0,                 from plperl.c:8:
../../../src/include/utils/elog.h:146:12: note: expected ‘const char *’ 
but argument is of type ‘int’ extern int errmsg(const char *fmt,...) pg_attribute_printf(1, 2);            ^
All of PostgreSQL successfully made. Ready to install.


make contrib:
In file included from hstore_plperl.c:6:0:
../../contrib/hstore/hstore.h:79:0: warning: "HS_KEY" redefined #define HS_KEY(arr_,str_,i_) ((str_) +
HSE_OFF((arr_)[2*(i_)]))^
 
In file included from 
/opt/perl-5.22/lib/5.22.0/x86_64-linux/CORE/perl.h:3730:0,                 from ../../src/pl/plperl/plperl.h:48,
        from hstore_plperl.c:4:
 
/opt/perl-5.22/lib/5.22.0/x86_64-linux/CORE/util.h:226:0: note: this is 
the location of the previous definition #  define HS_KEY(setxsubfn, popmark, apiver, xsver) \ ^

make check:  All 157 tests passed.



Erik Rijkers




Re: warning: HS_KEY redefined (9.5 beta2)

From
Alvaro Herrera
Date:
Erik Rijkers wrote:

> In file included from ../../../src/include/postgres.h:48:0,
>                  from plperl.c:8:
> plperl.c: In function ‘select_perl_context’:
> ../../../src/include/utils/elog.h:41:16: warning: passing argument 1 of
> ‘errmsg’ makes pointer from integer without a cast [-Wint-conversion]

Uh, this code has evidently never been compiled before, because it's
completely bogus:

#else    errmsg(ERROR,           (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),            errmsg("cannot allocate multiple
Perlinterpreters on this platform")));
 
#endif

It's recent breakage though, introduced in 09cecdf285ea.  Need to
s/errmsg/ereport/ ..

> make contrib:
> In file included from hstore_plperl.c:6:0:
> ../../contrib/hstore/hstore.h:79:0: warning: "HS_KEY" redefined
>  #define HS_KEY(arr_,str_,i_) ((str_) + HSE_OFF((arr_)[2*(i_)]))
>  ^
> In file included from
> /opt/perl-5.22/lib/5.22.0/x86_64-linux/CORE/perl.h:3730:0,
>                  from ../../src/pl/plperl/plperl.h:48,
>                  from hstore_plperl.c:4:
> /opt/perl-5.22/lib/5.22.0/x86_64-linux/CORE/util.h:226:0: note: this is the
> location of the previous definition
>  #  define HS_KEY(setxsubfn, popmark, apiver, xsver) \
>  ^

So we need to get this one fixed.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: warning: HS_KEY redefined (9.5 beta2)

From
Tom Lane
Date:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Erik Rijkers wrote:
>> make contrib:
>> In file included from hstore_plperl.c:6:0:
>> ../../contrib/hstore/hstore.h:79:0: warning: "HS_KEY" redefined
>> #define HS_KEY(arr_,str_,i_) ((str_) + HSE_OFF((arr_)[2*(i_)]))

> So we need to get this one fixed.

As for the HS_KEY conflict, I'm not too thrilled with the previous
suggestion of "#undef HS_KEY".  That seems pretty fragile, ie it
depends on inclusion order.  What do people think of doing
"s/HS_KEY/HSTORE_KEY/g"?  (I guess this would also hit the
HS_KEYLEN macro for consistency.)
        regards, tom lane