__attribute__ ((regparm(...))) in function declaration and gcc 3.4.0
Michael Matz
matz@suse.de
Mon Mar 1 08:03:00 GMT 2004
Hi,
On Mon, 1 Mar 2004, Giovanni Bajo wrote:
> Yes, but I don't know if this is intended. Maybe someone can clarify
> this? Otherwise we should file a bugreport.
It was intended, yes. (The immediate issue were funny runtime problems in
the linux kernel resulting from conflicting regparm specifications between
prototype and definition).
Zack suggested to lower this error to a warning if the definition doesn't
have _any_ regparm attribute (and then ensure that it will inherit the one
from the prototype, or the first decl). I've not yet looked at how to
make this happen reliably (the duplicate_decls mechanism is twisty), and I
also don't know if I would like it. Currently the rule is easy, and hence
simple. Every exception makes it more difficult, and I'm not sure if we
should sacrifice clarity for programmers using regparm's. They should be
able to use the right macro magic.
Ciao,
Michael.
More information about the Gcc
mailing list