RPM Community Forums

Mailing List Message of <rpm-devel>

empty struct in rpmdb/db_emu.h

From: David Halik <dhalik@jla.rutgers.edu>
Date: Sun 25 Nov 2007 - 03:35:49 CET
Message-ID: <4748DF85.2040908@jla.rutgers.edu>

Sun Studio and Solaris 9 is once again being more strict than gcc. I ran 
into this while compiling 5.0a3:

cc -c  -I../. -I../build -I../lib -I../popt -I../rpmdb -I../rpmio 
-I../rpmconstant -I/usr/local/include -I/usr/local/include/python2.4 
-I/usr/local/include/beecrypt -I/usr/local/ssl/include 
-DRPM_OS_SOLARIS=020900 -I/usr/local/include/neon   -g -xs -D_GNU_SOURCE 
-D_REENTRANT -D_LARGEFILE64_SOURCE -DNE_LFS   -g   -DVERSION=\"5.0a3\" 
-DXS_VERSION=\"5.0a3\" -KPIC 
"-I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE"   rpmxs.c
"../rpmdb/rpmtag.h", line 104: warning: enumerator value overflows 
INT_MAX (2147483647)
"../lib/rpmcli.h", line 157: warning: integer overflow detected: op "<<"
"../rpmdb/db_emu.h", line 38: warning: syntax error:  empty member 
declaration
"../rpmdb/db_emu.h", line 39: zero-sized struct/union
cc: acomp failed for rpmxs.c

A quick look at db_emu.h shows that struct __db_txn is in fact empty. A 
little googling points out that C99 does not allow empty struct 
declarations, so I'm guessing gcc is allowing it and continuing while SS 
is maor anal as usual. Can I just do an int dummy; here, or is there a 
more preferred workaround?

BTW, I decided to go with the much more simpler way of getting around my 
rpmconstant linking issue by including ../lib/.libs/librpm.so 
../rpmdb/.libs/librpmdb.so to the final rpmconstant linkage. I'm not 
sure if this is going to break down the road, but it seems to hold up so 
far.

-- 
================================
David Halik
Systems Programmer
OSS/NBCS - OIT Rutgers
dhalik@jla.rutgers.edu
================================
Received on Sun Nov 25 03:35:51 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.