Bug 6148 - Allow build with stricter type checking
Allow build with stricter type checking
Status: RESOLVED WONTFIX
Product: Samba 4.0
Classification: Unclassified
Component: Build
unspecified
Other Linux
: P5 enhancement
: ---
Assigned To: Jelmer Vernooij
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-01 20:05 UTC by Bug Reporter
Modified: 2009-06-29 22:41 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bug Reporter 2009-03-01 20:05:49 UTC
I'm trying to build but it fails:

~/svn/gnome2/samba-4.0.0alpha6/source4 $ make
Samba will be compiled with flags:
  CPP        = gcc -E
  CPPFLAGS   = -I./include -I. -I./lib -I./../lib/replace -I./../lib/talloc -I./.. -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H 
  CC         = gcc
  CFLAGS     = -g3 -pipe -O0 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wmissing-declarations -Wredundant-decls -Wshadow -Wwrite-strings -Winline -Wformat -Werror=format -Wformat-nonliteral -Werror=format-nonliteral -Wformat-security -Werror=format-security -Wfatal-errors -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wnested-externs
  PICFLAG    = -fPIC
  BNLD       = gcc
  BNLD_FLAGS = -L/opt/gnome2/lib64 -Wl,-O0 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -Wl,--export-dynamic
  STLD       = /usr/bin/ar
  STLD_FLAGS = -rcs
  SHLD       = gcc
  SHLD_FLAGS = -shared -Wl,-Bsymbolic 
  MDLD       = gcc
  MDLD_FLAGS = -shared -Wl,-Bsymbolic -Wl,--allow-shlib-undefined
  SHLIBEXT   = so
  srcdir     = .
  builddir   = .
  pwd        = ~/svn/gnome2/samba-4.0.0alpha6/source4
Compiling librpc/rpc/dcerpc.c
cc1: warning: lib/replace: No such file or directory
In file included from ./include/includes.h:23,
                 from librpc/rpc/dcerpc.c:23:
../lib/socket_wrapper/../replace/replace.h:185:6: warning: "HAVE_DECL_ENVIRON" is not defined
../lib/socket_wrapper/../replace/replace.h:668:5: warning: "MMAP_BLACKLIST" is not defined
In file included from ./../lib/util/util.h:28,
                 from ./include/includes.h:47,
                 from librpc/rpc/dcerpc.c:24:
./../lib/util/charset/charset.h:106: warning: redundant redeclaration of ‘strchr_m’
./../lib/util/charset/charset.h:85: warning: previous declaration of ‘strchr_m’ was here
In file included from ./librpc/rpc/dcerpc.h:33,
                 from librpc/rpc/dcerpc.c:27:
./../librpc/ndr/libndr.h:494: warning: redundant redeclaration of ‘ndr_print_bitmap_flag’
./../librpc/ndr/libndr.h:493: warning: previous declaration of ‘ndr_print_bitmap_flag’ was here
In file included from librpc/rpc/dcerpc.c:28:
./librpc/rpc/dcerpc_proto.h:32: warning: redundant redeclaration of ‘dcerpc_request’
./librpc/rpc/dcerpc.h:376: warning: previous declaration of ‘dcerpc_request’ was here
./librpc/rpc/dcerpc_proto.h:43: warning: redundant redeclaration of ‘dcerpc_ndr_request_send’
./librpc/rpc/dcerpc.h:255: warning: previous declaration of ‘dcerpc_ndr_request_send’ was here
./librpc/rpc/dcerpc_proto.h:167: warning: redundant redeclaration of ‘dcerpc_pipe_connect_recv’
./librpc/rpc/dcerpc.h:334: warning: previous declaration of ‘dcerpc_pipe_connect_recv’ was here
./librpc/rpc/dcerpc_proto.h:178: warning: redundant redeclaration of ‘dcerpc_transport_by_endpoint_protocol’
./librpc/rpc/dcerpc.h:386: warning: previous declaration of ‘dcerpc_transport_by_endpoint_protocol’ was here
In file included from librpc/rpc/dcerpc.c:29:
./../librpc/gen_ndr/ndr_misc.h:12: warning: redundant redeclaration of ‘ndr_print_GUID’
./../librpc/ndr/libndr.h:360: warning: previous declaration of ‘ndr_print_GUID’ was here
./../librpc/gen_ndr/ndr_misc.h:17: warning: redundant redeclaration of ‘ndr_push_policy_handle’
./../librpc/ndr/libndr.h:474: warning: previous declaration of ‘ndr_push_policy_handle’ was here
./../librpc/gen_ndr/ndr_misc.h:18: warning: redundant redeclaration of ‘ndr_pull_policy_handle’
./../librpc/ndr/libndr.h:473: warning: previous declaration of ‘ndr_pull_policy_handle’ was here
./../librpc/gen_ndr/ndr_misc.h:19: warning: redundant redeclaration of ‘ndr_print_policy_handle’
./../librpc/ndr/libndr.h:475: warning: previous declaration of ‘ndr_print_policy_handle’ was here
librpc/rpc/dcerpc.c: In function ‘dcerpc_init’:
librpc/rpc/dcerpc.c:35: warning: function returns an aggregate
librpc/rpc/dcerpc.c:36: warning: function call has aggregate value
librpc/rpc/dcerpc.c: In function ‘ncacn_pull’:
librpc/rpc/dcerpc.c:190: warning: function returns an aggregate
librpc/rpc/dcerpc.c:205: warning: function call has aggregate value
librpc/rpc/dcerpc.c: In function ‘ncacn_pull_request_auth’:
librpc/rpc/dcerpc.c:217: warning: function returns an aggregate
librpc/rpc/dcerpc.c:273: warning: function call has aggregate value
librpc/rpc/dcerpc.c:280: warning: function call has aggregate value
librpc/rpc/dcerpc.c:293: warning: function call has aggregate value
librpc/rpc/dcerpc.c: In function ‘ncacn_push_request_sign’:
librpc/rpc/dcerpc.c:447: error: format ‘%u’ expects type ‘unsigned int’, but argument 2 has type ‘size_t’
compilation terminated due to -Wfatal-errors.
The following command failed:
gcc -g3 -pipe -O0 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wmissing-declarations -Wredundant-decls -Wshadow -Wwrite-strings -Winline -Wformat -Werror=format -Wformat-nonliteral -Werror=format-nonliteral -Wformat-security -Werror=format-security -Wfatal-errors -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wnested-externs -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/include     -Iheimdal/../heimdal_build -Iheimdal/lib/gssapi -Iheimdal/lib/gssapi/gssapi -Iheimdal/lib/gssapi/spnego -Iheimdal/lib/gssapi/krb5 -Iheimdal/lib/gssapi/mech -Iheimdal_build -Iheimdal/lib/roken -Iheimdal/lib/gssapi  -g3 -pipe -O0 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wmissing-declarations -Wredundant-decls -Wshadow -Wwrite-strings -Winline -Wformat -Werror=format -Wformat-nonliteral -Werror=format-nonliteral -Wformat-security -Werror=format-security -Wfatal-errors -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wnested-externs -Iheimdal/../heimdal_build -Iheimdal/lib/hdb -Iheimdal/lib/hdb   -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/ldb_tdb   -Ilib/ldb/include -Ilib/ldb/include   -Iheimdal/../heimdal_build -Iheimdal/lib/krb5 -Iheimdal/lib/asn1 -Iheimdal/lib/com_err -Iheimdal/../heimdal_build -Iheimdal/lib/hx509 -Iheimdal/lib/hx509 -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/lib/hx509 -Iheimdal/../heimdal_build -Iheimdal/lib/hcrypto -Iheimdal/lib -Iheimdal/../heimdal_build -Iheimdal/lib/hcrypto/imath -Iheimdal/../heimdal_build -Iheimdal/lib/wind -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/../heimdal_build -Iheimdal/lib/asn1 -Iheimdal/../heimdal_build -Iheimdal/lib/com_err -Iheimdal/../heimdal_build -Iheimdal/lib/roken -I../lib/socket_wrapper   -Ilib/events   -Ilib/replace    -g3 -pipe -O0 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wmissing-declarations -Wredundant-decls -Wshadow -Wwrite-strings -Winline -Wformat -Werror=format -Wformat-nonliteral -Werror=format-nonliteral -Wformat-security -Werror=format-security -Wfatal-errors -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wnested-externs       -fPIC -I./include -I. -I./lib -I./../lib/replace -I./../lib/talloc -I./.. -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H  -c librpc/rpc/dcerpc.c -o librpc/rpc/dcerpc.o
make: *** [librpc/rpc/dcerpc.o] Error 1
~/svn/gnome2/samba-4.0.0alpha6/source4 $
Comment 1 Matthias Dieter Wallnöfer 2009-03-04 07:16:54 UTC
The problem is here is that you build with "-Wfatal-errors", which enables strict type checking and disables implicit casts.
If you can live without the option, please close with "WORKSFORME" otherwise we keep it open with low priority.
Comment 2 Matthias Dieter Wallnöfer 2009-03-04 08:06:22 UTC
After a closer test it looks not to be solely the problem of "-Wfatal-errors" but of other options as well.
Comment 3 Andrew Bartlett 2009-06-29 22:41:37 UTC
I don't see how Samba4 will ever compile with -Waggregate-return (given our use of DATA_BLOB).