This is the mail archive of the
gcc@gcc.gnu.org
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: <87oerix8sf.fsf@bot.ru> <Pine.SOL.4.58.0402292216350.18360@red.csi.cam.ac.uk><528301c3ff25$f941fcb0$aa422597@bagio>
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.