3050f832 broke the build of Samba 4 on QNX because it cannot find the definition of uint_t when compiling param/provision.c: Compiling param/provision.c In file included from /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:26, from param/provision.c:28: /home/build/build_farm/samba_4_0_test/source/libcli/raw/request.h:61: error: expected specifier-qualifier-list before 'uint_t' In file included from param/provision.c:28: /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:66: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:95: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:124: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:195: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:258: error: expected specifier-qualifier-list before 'uint_t' In file included from /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:310, from param/provision.c:28: /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:188: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:491: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:581: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:588: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:735: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:996: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:1477: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:2487: error: expected specifier-qualifier-list before 'uint_t' /home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:2571: error: expected specifier-qualifier-list before 'uint_t' The following command failed: ccache gcc -I/usr/local/stow/python-2.6.2/include/python2.6 -I/usr/local/stow/python-2.6.2/include/python2.6 -Ilib/ldb/include -Ilib/ldb/include -I./lib/ldb/include -I/home/build/build_farm/samba_4_0_test/source/lib/ldb/include -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/include -Iheimdal/../heimdal_build -Iheimdal/lib/hdb -I./heimdal_build -I/home/build/build_farm/samba_4_0_test/source/heimdal_build -I./heimdal/lib/roken -I/home/build/build_farm/samba_4_0_test/source/heimdal/lib/roken -Iheimdal/lib/hdb -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/ldb_tdb -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/lib/gssapi -Iheimdal/lib/gssapi -I../lib/tdb/include -I/home/build/build_farm/samba_4_0_test/source/../lib/talloc -I../lib/zlib -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 -Iheimdal/include -I../lib/socket_wrapper -I./lib/events -I/home/build/build_farm/samba_4_0_test/source/lib/events -I/usr/local/include -I../lib/tevent -I../lib/talloc -Ilib/replace -I/usr/local/stow/python-2.6.2/include/python2.6 -I/usr/local/stow/python-2.6.2/include/python2.6 -I/home/build/build_farm/samba_4_0_test/source/include -I/home/build/build_farm/samba_4_0_test/source -I/home/build/build_farm/samba_4_0_test/source/lib -I/home/build/build_farm/samba_4_0_test/source/../lib/replace -I/home/build/build_farm/samba_4_0_test/source/../lib/talloc -I/home/build/build_farm/samba_4_0_test/source/.. -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H -c param/provision.c -o param/provision.o make: *** [param/provision.o] Error 1 3050f832 changed param/provision.c to include Python.h before any other headers. The Python headers define _POSIX_C_SOURCE to 200112L. When they include sys/types.h, this definition prevents sys/types.h from defining uint_t. Before this commit, the Samba headers would include sys/types.h without defining _POSIX_C_SOURCE, which would cause the header to define uint_t.
It seems to be hard to do it properly. On most platforms the mentioned commit 3050f832 didn't change anything. To be honest I think that it's more a bug of the python or system header of QNX than our problem. Since including a "Python.h" at the top shouldn't prevent the use of "uint_t" at all. As workaround I suggest to add a "#define uint_t unsigned" at the bottom of the system "Python.h" file for now. Then I would inform the python project about this interesting bug.
(In reply to comment #1) > As workaround I suggest to add a "#define uint_t unsigned" at the bottom of the > system "Python.h" file for now. Then I would inform the python project about > this interesting bug. Done. See http://bugs.python.org/issue7209.
Matt, please inform us when the python project handles your bug request. If they don't we have to find a viable solution in our code base.
(In reply to comment #3) > Matt, please inform us when the python project handles your bug request. If > they don't we have to find a viable solution in our code base. Will do. Unfortunately, in my experience they don't seem to be very responsive (c.f., http://bugs.python.org/issue4532). :(
Well, I think we need to find a solution here (since as you said the python project doesn't care about QNX). I would like to hear Jelmer's or metze's opinion about such a corrective "uint_t" define. I thought maybe to put it into "libreplace" (but where exactly does it fit? In a header?).
Can't we just avoid using uint_t altogether but use "unsigned int" ? That should work everywhere.
(In reply to comment #6) > Can't we just avoid using uint_t altogether but use "unsigned int" ? That > should work everywhere. > Sure, Jelmer. But we have approximately 360 lines where this is used (counted with "cscope"). And also if we would change all those lines we aren't sure that someone reintroduces "uint_t"s. Therefore I suggest a substitution macro.
(In reply to comment #7) > Sure, Jelmer. But we have approximately 360 lines where this is used (counted > with "cscope"). And also if we would change all those lines we aren't sure that > someone reintroduces "uint_t"s. Therefore I suggest a substitution macro. libreplace already checks whether the system provides a definition of uint_t and, if it doesn't, defines it to be an unsigned int. On QNX, which does normally define uint_t, this does nothing. In this bug, the problem is that the Python headers, which are included first, prevent the system headers from defining uint_t. Since libreplace thinks it doesn't need to provide a definition, no definition is provided anywhere and the build breaks.
Created attachment 5099 [details] Change uint_t to unsigned int The following patch removes checks for and definitions of uint_t and changes uses of uint_t to unsigned int.
Created attachment 5100 [details] Change uint_t to unsigned int The previous patch was generated against an old revision and had conflicts when applied to the latest revision. This patch applies cleanly against 7cb858e.
Can you please split this patch into smaller parts: lib/crypto/ lib/talloc/ lib/util/ libcli/ pidl/ source3/ source4/ lib/replace/
(In reply to comment #11) > Can you please split this patch into smaller parts: > > lib/crypto/ > lib/talloc/ > lib/util/ > libcli/ > pidl/ > source3/ > source4/ > lib/replace/ Sure.
Created attachment 5121 [details] Change uint_t to unsigned int in lib/crypto
Created attachment 5122 [details] Change uint_t to unsigned int in lib/talloc
Created attachment 5123 [details] Change uint_t to unsigned int in lib/util
Created attachment 5124 [details] Change uint_t to unsigned int in libcli
Created attachment 5125 [details] Change uint_t to unsigned int in pidl
Created attachment 5126 [details] Change uint_t to unsigned int in source3
Created attachment 5127 [details] Change uint_t to unsigned int in source4
Created attachment 5128 [details] Change uint_t to unsigned int in lib/replace
Jelmer, Metze here we really need to find a solution!
Thanks Matt to provide the patches and metze for merging them! I close this as "FIXED".