pupa-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Readline patch


From: Jeroen Dekkers
Subject: Re: Readline patch
Date: Sun, 30 Nov 2003 19:36:07 +0100
User-agent: Mutt/1.5.4i

On Sun, Nov 30, 2003 at 06:43:34PM +0100, Yoshinori K. Okuji wrote:
> On Saturday 29 November 2003 21:42, Marco Gerards wrote:
> > +  int __attribute__ ((__regparm__ (2)))
> > +    add_completion (const char *comp, const char *match, const char
> > *what, +                void (*print_completion) (char *))
> > +    {
> 
> I think this code would suprise those who don't know the background of 
> PUPA very much. They would say, "What is this strange attribute at 
> all?"
> 
> And, this code is even bad for other architectures, as regparm is only 
> supported by i386 and x86-64. Also, you don't need this workaround, if 
> you use a good version of GCC.
> 
> Therefore, this would be better:
> 
> 1. Define a macro, like NESTED_FUNC_ATTR.
> 2. Set the macro to "__attribute__ ((__regparm__ (2)))", only if regparm 
> is supported by GCC and GCC is buggy. Otherwise, set it to an empty 
> value.
> 
> I think the 2nd step could be done in the configure script, although I'm 
> not sure how to check if GCC is buggy.

I think that checking the version of gcc is the best way. 

Jeroen Dekkers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]