Bug 215861

Summary: GCC 12.0.1 compiler complains on comparing addresses of 2 arrays
Product: Drivers Reporter: Erich Löw (Erich.Loew)
Component: NetworkAssignee: drivers_network (drivers_network)
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.3.17 Subsystem:
Regression: No Bisected commit-id:

Description Erich Löw 2022-04-18 12:21:43 UTC
Date:    20220418
Kernel:  5.17.3
Compiler GCC 12.0.1
File:    linux-5.17.3/drivers/net/ethernet/sun/cassini.c
Line:    1328
Issue: GCC 12.0.1 complains on comparing addresses of 2 arrays
       like this:
       CAS_HP_FIRMWARE == cas_prog_null
Ad hoc mitigation: the compiler proposes the more clean annotation as follows:
       &cas_prog_workaroundtab[0] == &cas_prog_null[0]
Interesting: clang-15.0.0 does not complain.
Remarks: this occurrence is representative; the GCC 12.0.1 compiler warns at
        many places.
        I looked as well to older kernels; the topic is in there since 20 Years.
        Just GCC 12.0.1 complains on it right now.
Global mitigation: adding "-Wno-array-compare" to the GCC compiler options 
                   of kernel root Makefile.