Bug 8557 - Use of <stdbool.h> is valid only in a c99 compilation environment
Summary: Use of <stdbool.h> is valid only in a c99 compilation environment
Status: NEW
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.6.7
Hardware: Sparc Solaris
: P5 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-31 18:17 UTC by Andrew Morgan
Modified: 2012-08-20 14:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Morgan 2011-10-31 18:17:45 UTC
Compilation of 3.6.1 fails on Solaris 10 SPARC with the following error:

Using CFLAGS     = -O -I. -I/private/src/samba-3.6.1/source3 -I/private/src/samba-3.6.1/source3/../lib/iniparser/src -Iinclude -I./include  -I. -I. -I./../lib/replace -I./../lib/tevent -I./librpc -I./.. -I./../lib/talloc -I../lib/tdb/include -DHAVE_CONFIG_H  -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLDAP_DEPRECATED -DSUNOS5  -I/private/src/samba-3.6.1/source3/lib -I.. -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3
      PICFLAG    = -fPIC
      LIBS       = -lsendfile -lresolv -lrt -lnsl -lsocket -lrt
      LDFLAGS    = -pie  -lthread -L./bin
      DYNEXP     = 
      LDSHFLAGS  = -fPIC -shared  -lthread -L./bin -lc -Wl,-z,defs
      SHLIBEXT   = so
      SONAMEFLAG = -Wl,-h,
Compiling ../lib/talloc/talloc.c
In file included from ./../lib/replace/replace.h:581,
                 from ../lib/talloc/talloc.c:33:
/usr/include/stdbool.h:42:2: #error "Use of <stdbool.h> is valid only in a c99 compilation environment."
../lib/talloc/talloc.c:120: error: syntax error before "bool"
../lib/talloc/talloc.c:120: warning: no semicolon at end of struct or union
../lib/talloc/talloc.c:121: warning: data definition has no type or storage class
../lib/talloc/talloc.c:123: error: syntax error before '}' token
../lib/talloc/talloc.c:123: warning: data definition has no type or storage class
../lib/talloc/talloc.c: In function `talloc_pool':
../lib/talloc/talloc.c:612: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:612: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c: In function `_talloc_free_poolmem':
../lib/talloc/talloc.c:730: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:730: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c:750: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:750: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c:759: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:759: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c: In function `_talloc_free_internal':
../lib/talloc/talloc.c:787: error: request for member `initialised' in something not a structure or union
../lib/talloc/talloc.c:790: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:791: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c:793: error: request for member `initialised' in something not a structure or union
../lib/talloc/talloc.c:869: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:869: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c:875: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:875: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c: In function `_talloc_realloc':
../lib/talloc/talloc.c:1384: error: `bool' undeclared (first use in this function)
../lib/talloc/talloc.c:1384: error: (Each undeclared identifier is reported only once
../lib/talloc/talloc.c:1384: error: for each function it appears in.)
../lib/talloc/talloc.c:1384: error: syntax error before "malloced"
../lib/talloc/talloc.c:1424: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:1424: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c:1439: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:1439: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c:1527: error: request for member `enabled' in something not a structure or union
../lib/talloc/talloc.c:1527: error: request for member `fill_value' in something not a structure or union
../lib/talloc/talloc.c:1565: error: `malloced' undeclared (first use in this function)
The following command failed:
gcc -O -I. -I/private/src/samba-3.6.1/source3 -I/private/src/samba-3.6.1/source3/../lib/iniparser/src -Iinclude -I./include  -I. -I. -I./../lib/replace -I./../lib/tevent -I./librpc -I./.. -I./../lib/talloc -I../lib/tdb/include -DHAVE_CONFIG_H  -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLDAP_DEPRECATED -DSUNOS5  -I/private/src/samba-3.6.1/source3/lib -I.. -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3 -fPIC -c ../lib/talloc/talloc.c -o ../lib/talloc/talloc.o
gmake: *** [../lib/talloc/talloc.o] Error 1


Compilation of Samba 3.5.11 on the same machine succeeds.
Comment 1 Greg Robinson 2011-12-07 04:30:52 UTC
setting CFLAGS to -std=gnu99 fixes this
Comment 2 Andrew Morgan 2011-12-08 21:50:42 UTC
That fixes it for me.  Can this be handled automatically via configure?
Comment 3 Andrew Morgan 2012-08-20 14:42:17 UTC
Additional information - this error only occurs when I compile with --disable-shared-libs.

Note: This error still occurs in Samba 3.6.7.