Bug 215861 - GCC 12.0.1 compiler complains on comparing addresses of 2 arrays
Summary: GCC 12.0.1 compiler complains on comparing addresses of 2 arrays
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Network (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_network@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-18 12:21 UTC by Erich Löw
Modified: 2022-04-18 12:21 UTC (History)
0 users

See Also:
Kernel Version: 5.3.17
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.