https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667
--- Comment #53 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 28 Nov 2023, post+gcc at ralfj dot de wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667 > > --- Comment #51 from post+gcc at ralfj dot de --- > Oh great, I love it when one part of the C standard just adds exceptions to > statements made elsewhere. It's almost as if the authors want this to be as > hard to understand as possible... > > That then raises the question which version of the signature is actually used > for building (and optimizing) the function: the one in the declaration or the > one in the definition. Does the standard have an answer to that? For avoidance of doubt the frontends should drop non-semantic qualifiers from declarations then just in case the middle-end tries to apply semantics there. Like it does for const qualified reference arguments (OK, that's not C but C++). The middle-end also uses the qualifiers for diagnostic purposes.