killall.c: In function 'uptime': killall.c:132: warning: implicit declaration of function 'setlocale' killall.c:132: error: 'LC_NUMERIC' undeclared (first use in this function) killall.c:132: error: (Each undeclared identifier is reported only once killall.c:132: error: for each function it appears in.) The file clearly misses #include <locale.h>. I believe this problem can only be seen with >=gcc-4.4 as the headers are even more minimal than those of earlier versions.
Created attachment 214910 [details, diff] Patch to fix the problem
You know that psmisc-22.9 is p.masked because of bug #297423?
If you're using -O0, glibc will not include locale.h for you… OTOH uclibc might require a test HAVE_LOCALE_H to put it under conditional. Given that there is already code that calls setlocale() you should look for the same conditional here, rather than adding a new one.
Created attachment 214924 [details, diff] psmisc-22.9-locale.patch Include locale.h only if it's required and found. Try this.
(In reply to comment #4) > Created an attachment (id=214924) [details] > psmisc-22.9-locale.patch Or perhaps that's too much, just #ifdef HAVE_LOCALE_H #include <locale.h> #endif should be enough
Is HAVE_LOCALE_H already handled by autotools? In general if you have setlocale() you also have locale.h (they are both mandated by C99 standard), so the logic in the patch seem to be inverted.
(In reply to comment #6) > Is HAVE_LOCALE_H already handled by autotools? In general if you have > setlocale() you also have locale.h (they are both mandated by C99 standard), so > the logic in the patch seem to be inverted. > Yep, configure.ac has AC_CHECK_HEADERS for locale.h and AC_CHECK_FUNCS for setlocale, so both are available in config.h{,.in}
Then the short alternative is fine ;)
thanks diego ;) + 02 Jan 2010; Samuli Suominen <ssuominen@gentoo.org> psmisc-22.9.ebuild, + +files/psmisc-22.9-locale.patch: + Fix building with -O0 where glibc doesn't include locale.h by itself wrt + #299316.