[Nut-upsdev] libconf branch build failure: sigemptyset()

Charles Lepple clepple at gmail.com
Sun Mar 10 20:42:31 UTC 2013


Vaclav,

NUT is failing to build on OS X 10.6 and 10.7

With GCC/g++:

http://buildbot.networkupstools.org/public/nut/builders/MacOSX-10.6-x86/builds/340/steps/compile/logs/stdio

The same branch with clang/clang++:

/bin/sh ../libtool --tag=CXX   --mode=compile clang++ -DHAVE_CONFIG_H -I. -I../include    -I../include -g -O2 -MT nutipc.lo -MD -MP -MF .deps/nutipc.Tpo -c -o nutipc.lo nutipc.cpp
libtool: compile:  clang++ -DHAVE_CONFIG_H -I. -I../include -I../include -g -O2 -MT nutipc.lo -MD -MP -MF .deps/nutipc.Tpo -c nutipc.cpp  -fno-common -DPIC -o .libs/nutipc.o
In file included from nutipc.cpp:22:
../include/nutipc.hpp:646:5: error: expected unqualified-id
                ::sigemptyset(&action.sa_mask);
                  ^
/usr/include/signal.h:127:26: note: expanded from macro 'sigemptyset'
#define sigemptyset(set)        (*(set) = 0, 0)
                                ^

sigemptyset() probably should have been implemented as an inline function, but that's what we have to work with.

This particular error was masked by a problem with Makefile.am; see https://github.com/networkupstools/nut/commit/4290a0d0955b8437c57941cc64e2c941ab2d2094

I'd recommend dropping the :: for C library functions - if there is a method in another namespace whose name collides with the C library, there's bound to be confusion when someone is reading through the code.

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsdev mailing list