[klibc] Register parameters are unsafe with gcc 3.3.2

H. Peter Anvin hpa at zytor.com
Sat Jun 5 13:49:58 PDT 2004

H. Peter Anvin wrote:
> Alexander E. Patrakov wrote:
>> Other shell redirections don't work either. When I comment out the 
>> following line in klibc/klibc/arch/i386/MCONFIG:
>> # REGPARM_OPT := -mregparm=3 -DREGPARM
>> and rebuild klibc, everything works. Please take some action against 
>> this error, e.g. update the README file.
> It's not a gcc problem, it seems to be a bug in the klibc open() 
> function.  open() is a problematic function since it's technically 
> defined as being varadic, and with regparm varadic and non-varadic 
> functions have calling conventions.
> Thus, it's either a klibc or an ash problem, so it's in my court.  I'll 
> take care of it.

OK, sprinkling #include <unistd.h> across the ash directory did it.

If noone objecs, I'm also going to add the open() prototype to 
<fcntl.h>, since even old-style code included <fcntl.h> when using open().

Anyone would be brave enough to convert ash to prototype format?  That 
way we could use standard gcc warnings to warn for missing prototypes.


More information about the klibc mailing list