[OpenBIOS] build warnings on gcc6

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Mar 6 18:19:07 CET 2016


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.




More information about the OpenBIOS mailing list