openbios has some warnings (that are errors with -Werror) on gcc6. See results below, with gcc6 from fedora, and building openbios revision 1378
Thanks, Cole
/builddir/build/BUILD/openbios-1.1/libc/string.c: In function 'strdup': /builddir/build/BUILD/openbios-1.1/libc/string.c:353:4: warning: nonnull argument 'str' compared to NULL [-Wnonnull-compare] if( !str )
In file included from /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:14:0: /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:391:14: warning: 'ob_sbus_node_m' defined but not used [-Wunused-const-variable] NODE_METHODS(ob_sbus_node) = { ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:139:23: note: in definition of macro 'NODE_METHODS' static const method_t name##_m[]
In file included from /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:12:0: /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:444:14: warning: 'mmu_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(mmu, INSTALL_OPEN, 0, "/virtual-memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \ ^~~~ /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:436:14: warning: 'memory_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(memory, INSTALL_OPEN, 0, "/memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \
On Mar 5, 2016, at 5:33 PM, Cole Robinson wrote:
openbios has some warnings (that are errors with -Werror) on gcc6. See results below, with gcc6 from fedora, and building openbios revision 1378
Thanks, Cole
/builddir/build/BUILD/openbios-1.1/libc/string.c: In function 'strdup': /builddir/build/BUILD/openbios-1.1/libc/string.c:353:4: warning: nonnull argument 'str' compared to NULL [-Wnonnull-compare] if( !str )
In file included from /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:14:0: /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:391:14: warning: 'ob_sbus_node_m' defined but not used [-Wunused-const-variable] NODE_METHODS(ob_sbus_node) = { ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:139:23: note: in definition of macro 'NODE_METHODS' static const method_t name##_m[]
In file included from /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:12:0: /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:444:14: warning: 'mmu_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(mmu, INSTALL_OPEN, 0, "/virtual-memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \ ^~~~ /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:436:14: warning: 'memory_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(memory, INSTALL_OPEN, 0, "/memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \
Thank you very much for alerting us to this problem. I think it is time for this patch:
makefile.target: Remove Werror
Just because a warning is issued by the compiler doesn't mean the OpenBIOS binary is broken. Werror is used to halt building if the compiler issues a warning. This patch removes Werror so building can continue after such a warning.
Signed-off-by: John Arbuckle programmingkidx@gmail.com
Index: Makefile.target =================================================================== --- Makefile.target (revision 1391) +++ Makefile.target (working copy) @@ -29,7 +29,6 @@ CFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith CFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels CFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs -CFLAGS+= -Werror # Flags for dependency generation CFLAGS+= -MMD -MP -MT $@ -MF '$(*D)/$(*F).d' INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
On 06/03/16 15:23, Programmingkid wrote:
On Mar 5, 2016, at 5:33 PM, Cole Robinson wrote:
openbios has some warnings (that are errors with -Werror) on gcc6. See results below, with gcc6 from fedora, and building openbios revision 1378
Thanks, Cole
/builddir/build/BUILD/openbios-1.1/libc/string.c: In function 'strdup': /builddir/build/BUILD/openbios-1.1/libc/string.c:353:4: warning: nonnull argument 'str' compared to NULL [-Wnonnull-compare] if( !str )
In file included from /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:14:0: /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:391:14: warning: 'ob_sbus_node_m' defined but not used [-Wunused-const-variable] NODE_METHODS(ob_sbus_node) = { ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:139:23: note: in definition of macro 'NODE_METHODS' static const method_t name##_m[]
In file included from /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:12:0: /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:444:14: warning: 'mmu_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(mmu, INSTALL_OPEN, 0, "/virtual-memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \ ^~~~ /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:436:14: warning: 'memory_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(memory, INSTALL_OPEN, 0, "/memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \
Thank you very much for alerting us to this problem. I think it is time for this patch:
makefile.target: Remove Werror
Just because a warning is issued by the compiler doesn't mean the OpenBIOS binary is broken. Werror is used to halt building if the compiler issues a warning. This patch removes Werror so building can continue after such a warning.
That may be true, but the compiler is trying to tell us something here. The worst case scenario is that we may need to disable one specific warning if it really is unavoidable, but blanket disabling of Werror is not the correct solution here.
Regardless of the outcome, the first thing to do here is to analyse the warnings and determine if they are genuine before even considering a patch.
ATB,
Mark.
On Sun, Mar 06, 2016 at 05:19:07PM +0000, Mark Cave-Ayland wrote:
Just because a warning is issued by the compiler doesn't mean the OpenBIOS binary is broken. Werror is used to halt building if the compiler issues a warning. This patch removes Werror so building can continue after such a warning.
That may be true, but the compiler is trying to tell us something here. The worst case scenario is that we may need to disable one specific warning if it really is unavoidable, but blanket disabling of Werror is not the correct solution here.
You really need some way to disable it then, though.
Regardless of the outcome, the first thing to do here is to analyse the warnings and determine if they are genuine before even considering a patch.
The -Wunused-const-variable warning is correct. The -Wnonnull-compare warning may be, I'd have to look at surrounding code. There are known problems with this warning. In general, don't modify your code just to shut up pre-release compiler versions, not without analysing the issue first (and please tell us about false positives!)
Segher
On 05/03/16 22:33, Cole Robinson wrote:
openbios has some warnings (that are errors with -Werror) on gcc6. See results below, with gcc6 from fedora, and building openbios revision 1378
Thanks, Cole
/builddir/build/BUILD/openbios-1.1/libc/string.c: In function 'strdup': /builddir/build/BUILD/openbios-1.1/libc/string.c:353:4: warning: nonnull argument 'str' compared to NULL [-Wnonnull-compare] if( !str )
In file included from /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:14:0: /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:391:14: warning: 'ob_sbus_node_m' defined but not used [-Wunused-const-variable] NODE_METHODS(ob_sbus_node) = { ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:139:23: note: in definition of macro 'NODE_METHODS' static const method_t name##_m[]
In file included from /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:12:0: /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:444:14: warning: 'mmu_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(mmu, INSTALL_OPEN, 0, "/virtual-memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \ ^~~~ /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:436:14: warning: 'memory_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(memory, INSTALL_OPEN, 0, "/memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \
Apart from the -Wnonnull-compare warning in strdup (which I can only assume figures that const char * pointers are non-null), these warnings do appear to be valid.
Sadly I don't have gcc6 around yet (I only install released compiler packages here) but I think I can fix these up. Do you have the complete out for sparc32, sparc64 and ppc binaries so I can also look at these or is it just the sparc64 build that fails?
ATB,
Mark.
On Sun, Mar 06, 2016 at 05:10:15PM +0000, Mark Cave-Ayland wrote:
Apart from the -Wnonnull-compare warning in strdup (which I can only assume figures that const char * pointers are non-null), these warnings do appear to be valid.
It seems to be http://gcc/gnu/org/PR69835 (and many duplicates), which already was fixed on Feb 16.
Segher
On 03/06/2016 12:10 PM, Mark Cave-Ayland wrote:
On 05/03/16 22:33, Cole Robinson wrote:
openbios has some warnings (that are errors with -Werror) on gcc6. See results below, with gcc6 from fedora, and building openbios revision 1378
Thanks, Cole
/builddir/build/BUILD/openbios-1.1/libc/string.c: In function 'strdup': /builddir/build/BUILD/openbios-1.1/libc/string.c:353:4: warning: nonnull argument 'str' compared to NULL [-Wnonnull-compare] if( !str )
In file included from /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:14:0: /builddir/build/BUILD/openbios-1.1/drivers/sbus.c:391:14: warning: 'ob_sbus_node_m' defined but not used [-Wunused-const-variable] NODE_METHODS(ob_sbus_node) = { ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:139:23: note: in definition of macro 'NODE_METHODS' static const method_t name##_m[]
In file included from /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:12:0: /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:444:14: warning: 'mmu_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(mmu, INSTALL_OPEN, 0, "/virtual-memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \ ^~~~ /builddir/build/BUILD/openbios-1.1/arch/sparc64/lib.c:436:14: warning: 'memory_p' defined but not used [-Wunused-const-variable] DECLARE_NODE(memory, INSTALL_OPEN, 0, "/memory"); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:135:27: note: in definition of macro 'DECLARE_NODE' static const char * const name##_p[] = { paths }; \
Apart from the -Wnonnull-compare warning in strdup (which I can only assume figures that const char * pointers are non-null), these warnings do appear to be valid.
Sadly I don't have gcc6 around yet (I only install released compiler packages here) but I think I can fix these up. Do you have the complete out for sparc32, sparc64 and ppc binaries so I can also look at these or is it just the sparc64 build that fails?
Attached the full build output, with -Wno-error. There's some rpm build gunk in there but it's straightforward
Thanks, Cole
On 09/03/16 17:46, Cole Robinson wrote:
Sadly I don't have gcc6 around yet (I only install released compiler packages here) but I think I can fix these up. Do you have the complete out for sparc32, sparc64 and ppc binaries so I can also look at these or is it just the sparc64 build that fails?
Attached the full build output, with -Wno-error. There's some rpm build gunk in there but it's straightforward
Hi Cole,
Thanks for the output. I've just posted a patchset which should remove all of the warnings except the one emitted by -Wnonnull-compare so please test and let me know if it improves things.
Like Segher I'm not 100% convinced by the -Wnonnull-compare warning in this case, so I've left this for the moment. It does raise an eyebrow that Fedora are building with an as-yet unreleased compiler but can you confirm as a starting point whether the fix for PR69835 as indicated by Segher is being included in the gcc6 build you are using?
ATB,
Mark.
On 03/11/2016 11:30 AM, Mark Cave-Ayland wrote:
On 09/03/16 17:46, Cole Robinson wrote:
Sadly I don't have gcc6 around yet (I only install released compiler packages here) but I think I can fix these up. Do you have the complete out for sparc32, sparc64 and ppc binaries so I can also look at these or is it just the sparc64 build that fails?
Attached the full build output, with -Wno-error. There's some rpm build gunk in there but it's straightforward
Hi Cole,
Thanks for the output. I've just posted a patchset which should remove all of the warnings except the one emitted by -Wnonnull-compare so please test and let me know if it improves things.
Like Segher I'm not 100% convinced by the -Wnonnull-compare warning in this case, so I've left this for the moment. It does raise an eyebrow
For better or worse rinsing unreleased gcc versions in Fedora is basically one of gcc's pre-release steps, it's all shepherded by one of the primary gcc developers.
that Fedora are building with an as-yet unreleased compiler but can you confirm as a starting point whether the fix for PR69835 as indicated by Segher is being included in the gcc6 build you are using?
Unfortunately the RPM changelog seems to indicate it contains the patch for that issue... I haven't dug deeper yet
- Cole