https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106571

            Bug ID: 106571
           Summary: Implement -Wsection diag
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bp at alien8 dot de
  Target Milestone: ---

Hi,

clang has this -Wsection diag which does:

https://clang.llvm.org/docs/DiagnosticsReference.html#wsection

It would be good to have it in gcc too so that declarations like

extern u64 x86_spec_ctrl_current;

for variable definitions which belong to a specific section:

__attribute__((section(".data..percpu" ""))) __typeof__(u64)
x86_spec_ctrl_current;

get caught:

arch/x86/kernel/cpu/bugs.c:58:21: error: section attribute is specified on
redeclared variable [-Werror,-Wsection]

Thx.

Reply via email to