K&R prototypes?

Rob Landley rob at landley.net
Fri Sep 11 23:52:09 UTC 2009


I need to fix realpath() to do what posix 2008 requires (and what glibc has 
done for decades), which is to allocate its own buffer of appropriate length 
when the passed in buffer is NULL.

I'm working against 0.9.30.1 because current git is still trying to build host 
assembly for eery target architecture (yes, the ARCH thing I complained about 
last week is still broken), but I checked the realpath.c file against current 
git and although it's moved, the only thing that's changed was the 
hidden_proto removal.

My question is what standards is uClibc built against?  C99 has been out for a 
decade, and C89 (ala "ANSI C") has been out for 20 years, but the readpath.c 
code starts with:

#ifdef __STDC__
char *realpath(const char *path, char got_path[])
#else
char *realpath(path, got_path)
const char *path;
char got_path[];
#endif
{

Kernighan and Ritchie prototypes?  From 1978?  Really?

Is that honestly still necessary?  I'm attempting to deal with the fact that 
the 2.6 kernel series hasn't really got a PATH_MAX anymore, can I clean this 
out too while I'm there?

Rob
-- 
Latency is more important than throughput. It's that simple. - Linus Torvalds


More information about the uClibc mailing list