Error building libsepol with gcc 4.0
Hi,
There is a problem building 'libsepol' on amd64 with gcc-4.0:
cc -O2 -I. -I../include -c -o policydb.o policydb.c
policydb.c:29: error: static declaration of 'policydb_compat' follows non-static declaration private.h:27: error: previous declaration of 'policydb_compat' was here make[2]: *** [policydb.o] Error 1
make[2]: Leaving directory `/libsepol-1.2/src'
Which is indeed a problem (though gcc used to ignore it in the
past). Looking at it, policydb_compat is only used in policydb.c, so it can remain a static array of struct policydb_compat_info, and we can just remove the extern declaration from private.h.
The following should do the trick:
======================================================================
src/private.h +0 -1
@@ -24,7 +24,6 @@int ocon_num; }; -extern struct policydb_compat_info policydb_compat[];extern struct policydb_compat_info *policydb_lookup_compat (int version);/* Reading from a policy "file". */
======================================================================
manoj
Signature · 9 lines
He who utters only gentle, instructive and truthful speech, criticising no-one - that is what I call a brahmin. 408 Manoj Srivastava <[email protected]> <[email protected]> 1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 8 lines · Manoj Srivastava
There is a problem building 'libsepol' on amd64 with gcc-4.0:
cc -O2 -I. -I../include -c -o policydb.o
policydb.c
policydb.c:29: error: static declaration of 'policydb_compat' follows non-static declaration private.h:27: error: previous declaration of 'policydb_compat' was here make[2]: *** [policydb.o] Error 1
make[2]: Leaving directory `/libsepol-1.2/src'
Quoted 4 lines
Which is indeed a problem (though gcc used to ignore it in the
past). Looking at it,policydb_compatis only used inpolicydb.c, so it can remain a static array of structpolicydb_compat_info, and we can just remove the extern declaration fromprivate.h.
Thanks, merged into sourceforge CVS as of libsepol version 1.2.1.
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.