Problems with definition of __progname in utils/getconf.c when __UCLIBC_HAS___PROGNAME__ is not defined

Kevin Day thekevinday at gmail.com
Mon Jul 9 03:23:32 UTC 2012


The first problem:
On git master, the file utils/getconf.c, around line #1057, is missing
the ending semicolon.

#ifndef __UCLIBC_HAS___PROGNAME__
static const char *__progname = "getconf"
#endif

should be

#ifndef __UCLIBC_HAS___PROGNAME__
static const char *__progname = "getconf";
#endif


The second problem:
On git master, the file utils/getconf.c, around line #1057 defining
__progname as "static const char *".
the file include/errno.h, around line #51, is defining __progname as
"extern const char *".
This is causing a compile error for me:

  CC utils/getconf
In file included from ../include/sys/stat.h:107,
                 from ../include/fcntl.h:38,
                 from ../utils/porting.h:13,
                 from ../utils/getconf.c:19:
../include/bits/stat.h:112: warning: useless storage class specifier
in empty declaration
../include/bits/stat.h:168: warning: useless storage class specifier
in empty declaration
../utils/getconf.c:1057: error: static declaration of '__progname'
follows non-static declaration
../include/errno.h:51: note: previous declaration of '__progname' was here
make: *** [../utils/getconf] Error 1


Thus you should have:
#ifndef __UCLIBC_HAS___PROGNAME__
const char *__progname = "getconf";
#endif

-- 
Kevin Day


More information about the uClibc mailing list