[naemon-dev] tarball 0.8.0 fails to build rpm package on rhel6/centos6 (easy fix?)

LAHAYE Olivier olivier.lahaye at cea.fr
Wed May 28 17:46:06 CEST 2014


Hi,

I'm a developper of the OSCAR Cluster opensource software and I4m in the process of integrating naemon in se supported things that can be configured from the cluster install wizard.

For that, I'm integrating naemon into the oscar build system and while it works fin on fedora-20, it fails to build on centos-6 with the following errors.
(the build command is: rpmbuild -bb naemon-0.8.0.tar.gz)

...
...
# everything seems ok and then:

gcc -DHAVE_CONFIG_H -I. -I.. -I../naemon/lib  -D_GNU_SOURCE -I.. '-DSYSCONFDIR="/etc/naemon"' '-DLOCALSTATEDIR="/var/lib/naemon"' '-DLOGDIR="/var/log/naemon"' '-DLOCKFILE="/var/run/naemon/naemon.pid"' -DPREFIX='"/usr"'  -Wall -Werror -fPIC -Wextra -pipe -ggdb3 -Wredundant-decls -Wtrigraphs -Wdeclaration-after-statement -Wshadow -Wstrict-prototypes -Wno-unused-result -Wno-unused-parameter -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -MT naemon-naemon.o -MD -MP -MF .deps/naemon-naemon.Tpo -c -o naemon-naemon.o `test -f 'naemon.c' || echo './'`naemon.c
cc1: warnings being treated as errors
naemon.c: In function 'test_path_access':
naemon.c:94: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
naemon.c: In function 'nagios_core_worker':
naemon.c:148: error: ignoring return value of 'read', declared with attribute warn_unused_result
naemon.c: In function 'main':
naemon.c:547: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
naemon.c:763: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
At top level:
cc1: error: unrecognized command line option "-Wno-unused-result"
make[5]: *** [naemon-naemon.o] Error 1

=> doing make -k in the build directory show that the problem is in the following files:
naemon.c:94: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
naemon.c:148: error: ignoring return value of 'read', declared with attribute warn_unused_result
naemon.c:547: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
naemon.c:763: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:398: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:416: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:418: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:2219: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:2246: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
commands.c:279: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
commands.c:280: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
commands.c:869: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:43: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:104: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:109: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:116: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:121: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:152: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:170: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:185: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:210: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:222: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:236: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:292: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:303: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:314: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:325: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:336: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:347: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:358: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:369: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:380: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:391: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:403: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:412: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:423: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:436: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:466: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:477: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:488: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:504: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:522: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:533: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:544: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:555: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:566: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:577: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:586: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:608: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:626: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:664: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:675: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:693: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:704: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:725: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:735: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:745: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:759: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:768: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:784: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:795: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:806: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:817: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:829: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:839: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:846: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:858: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:868: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:878: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:889: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:908: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:918: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:928: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:938: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:999: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1010: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1117: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1391: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1402: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
downtime.c:421: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
downtime.c:423: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
flapping.c:225: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
flapping.c:308: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:238: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:266: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:293: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:326: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:381: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:458: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1163: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1164: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1165: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1166: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1167: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1168: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1169: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1170: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1171: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1172: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1173: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1174: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1175: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1176: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1177: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1178: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1661: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:2028: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:2214: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3093: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3120: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3134: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3147: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3176: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3200: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
nerd.c:346: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:197: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:203: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:745: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:748: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:751: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:754: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:757: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:760: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:763: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:766: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:769: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1135: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1141: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1639: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1642: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1645: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1648: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1651: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1654: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1657: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1660: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1663: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
query-handler.c:39: error: ignoring return value of 'write', declared with attribute warn_unused_result
sehandlers.c:243: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
sehandlers.c:343: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
sehandlers.c:486: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
sehandlers.c:585: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
utils.c:419: error: ignoring return value of 'write', declared with attribute warn_unused_result
utils.c:426: error: ignoring return value of 'write', declared with attribute warn_unused_result
utils.c:1590: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
utils.c:1592: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
utils.c:1679: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result
utils.c:1681: error: ignoring return value of 'write', declared with attribute warn_unused_result
utils.c:1860: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
utils.c:2074: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
workers.c:461: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
workers.c:675: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
workers.c:677: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
workers.c:682: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
xodtemplate.c:256: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
xodtemplate.c:274: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
xrddefault.c:94: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
xsddefault.c:106: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:398: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:416: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:418: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:2219: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:2246: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
commands.c:279: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
commands.c:280: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
commands.c:869: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:43: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:104: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:109: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:116: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:121: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:152: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:170: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:185: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:210: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:222: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:236: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:292: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:303: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:314: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:325: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:336: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:347: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:358: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:369: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:380: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:391: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:403: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:412: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:423: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:436: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:466: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:477: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:488: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:504: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:522: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:533: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:544: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:555: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:566: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:577: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:586: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:608: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:626: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:664: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:675: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:693: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:704: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:725: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:735: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:745: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:759: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:768: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:784: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:795: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:806: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:817: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:829: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:839: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:846: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:858: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:868: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:878: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:889: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:908: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:918: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:928: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:938: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:999: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1010: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1117: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1391: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1402: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result

Can this be fixed for next release? (either by disabling -Werror on centos6 or by fixing the warning by not ignoring the return code).

Best regards.
--
   Olivier LAHAYE
   CEA DRT/LIST/DIR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/naemon-dev/attachments/20140528/ae3a050a/attachment-0001.html>


More information about the Naemon-dev mailing list