This is the mail archive of the
mailing list for the GCC project.
Re: __attribute__ ((regparm(...))) in function declaration and gcc3.4.0
- From: Michael Matz <matz at suse dot de>
- To: Giovanni Bajo <giovannibajo at libero dot it>
- Cc: Nicholas Nethercote <njn25 at cam dot ac dot uk>,Serge Belyshev <1319 at bot dot ru>, gcc at gcc dot gnu dot org,Zack Weinberg <zack at codesourcery dot com>
- Date: Mon, 1 Mar 2004 09:03:02 +0100 (CET)
- Subject: Re: __attribute__ ((regparm(...))) in function declaration and gcc3.4.0
- References: <firstname.lastname@example.org> <Pine.SOL.email@example.com><528301c3ff25$f941fcb0$aa422597@bagio>
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.