https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106571
Michael Matz <matz at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matz at gcc dot gnu.org --- Comment #4 from Michael Matz <matz at gcc dot gnu.org> --- To elaborate: normally you don't need to know which section a variable will be placed into when generating code to access it. (In fact you don't even need to know if it's defined in the same linking component at all) So, for declarations the section is immaterial, and checking for a mismatch between decl and def doesn't seem appropriate. In the general case. This is not the general case, the per-cpu sections of the kernel have special semantics, and I agree with Andrew that checking would be better implemented with something orthogonal to the section attribute itself. Boris: what does DECLARE_PER_CPU() expand into? Are there other attributes that could be usefully checked for mismatch between decl and def?