Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 430894

Summary: sys-power/apcupsd[snmp] - In file included from drv_rfc1628.c:27:0: snmp.h:82:10: error: expected unqualified-id before numeric constant
Product: Gentoo Linux Reporter: Fabio Coatti <fabio.coatti>
Component: [OLD] Core systemAssignee: Matthew Marlowe (RETIRED) <mattm>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: base-system, camden.lindsay+gentoo, da5id2001, deference, herber, holger, nuklea, oliver, praetor.zero, r3pek, rose, stathis, tb, themgt, zolcos
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Change MIB to mib to build with latest net-snmp

Description Fabio Coatti 2012-08-11 08:42:07 UTC
I'm tring to rebuild sys-power/apcupsd-3.14.10-r1 after libnetsnmp upgrade, but it fails with the following errors:

  MAN   apctest.8 -> apctest.man.txt
  MAN   apccontrol.8 -> apccontrol.man.txt
        src/drivers/apcsmart
ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded: ignored.
  CXX   src/lib/apcconfig.c
  CXX   src/drivers/apcsmart/smartsetup2.c


and:
In file included from drv_rfc1628.c:27:0:
snmp.h:82:10: error: expected unqualified-id before numeric constant
snmp.h:82:9: error: expected ‘;’ at end of member declaration
snmp.h:82:10: error: expected unqualified-id before numeric constant
drv_rfc1628.c: In function ‘int rfc_1628_check_alarms(UPSINFO*)’:
drv_rfc1628.c:35:40: error: expected unqualified-id before numeric constant
drv_rfc1628.c:35:40: error: expected ‘,’ or ‘;’ before numeric constant
drv_rfc1628.c: In function ‘int rfc1628_snmp_ups_read_static_data(UPSINFO*)’:
drv_rfc1628.c:79:40: error: expected unqualified-id before numeric constant
drv_rfc1628.c:79:40: error: expected ‘,’ or ‘;’ before numeric constant
drv_rfc1628.c: In function ‘int rfc1628_snmp_ups_read_volatile_data(UPSINFO*)’:
drv_rfc1628.c:101:40: error: expected unqualified-id before numeric constant
drv_rfc1628.c:101:40: error: expected ‘,’ or ‘;’ before numeric constant
make[4]: *** [.obj/drv_rfc1628.o] Errore 1
make[4]: *** Attesa dei processi non terminati....
  CXX   src/drivers/snmplite/apc-mib.cpp
  CXX   src/drivers/usb/usb.c
In file included from drv_powernet.c:27:0:
snmp.h:82:10: error: expected unqualified-id before numeric constant
snmp.h:82:9: error: expected ‘;’ at end of member declaration
snmp.h:82:10: error: expected unqualified-id before numeric constant
drv_powernet.c: In function ‘int powernet_check_comm_lost(UPSINFO*)’:
drv_powernet.c:37:50: error: expected unqualified-id before numeric constant
drv_powernet.c:37:50: error: expected ‘,’ or ‘;’ before numeric constant
drv_powernet.c: In function ‘int powernet_snmp_ups_read_static_data(UPSINFO*)’:
drv_powernet.c:164:50: error: expected unqualified-id before numeric constant
drv_powernet.c:164:50: error: expected ‘,’ or ‘;’ before numeric constant
drv_powernet.c: In function ‘int powernet_snmp_ups_read_volatile_data(UPSINFO*)’:
drv_powernet.c:303:50: error: expected unqualified-id before numeric constant
drv_powernet.c:303:50: error: expected ‘,’ or ‘;’ before numeric constant
make[4]: *** [.obj/drv_powernet.o] Errore 1
make[3]: *** [all] Errore 2
make[2]: *** [snmp_DIR] Errore 2
make[2]: *** Attesa dei processi non terminati....
  CXX   src/drivers/snmplite/mge-mib.cpp
  CXX   src/lib/apclog.c
apclog.c: In function ‘void log_event(const UPSINFO*, int, const char*, ...)’:
apclog.c:68:50: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
apclog.c:74:31: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
  CXX   src/drivers/snmplite/snmplite.cpp
  CXX   src/drivers/snmplite/snmp.cpp
  CXX   src/lib/apcsignal.c
  CXX   src/lib/apcstatus.c
  CXX   src/lib/asys.c
  CXX   src/lib/newups.c
  CXX   src/lib/md5.c
  CXX   src/lib/statmgr.cpp
  CXX   src/lib/gethostname.c
  CXX   src/lib/amutex.cpp
  CXX   src/lib/astring.cpp
  CXX   src/lib/autil.cpp
  CXX   src/lib/atimer.cpp
  CXX   src/lib/athread.cpp
  CXX   src/lib/libsupc++fix.cpp
make[1]: *** [drivers_DIR] Errore 2
make[1]: *** Attesa dei processi non terminati....
  AR    src/lib/libapc.a
make: *** [src_DIR] Errore 2
 * ERROR: sys-power/apcupsd-3.14.10-r1 failed (compile phase):
 *   emake failed



Reproducible: Always




kefk ~ # emerge --info
Portage 2.2.0_alpha120 (default/linux/amd64/10.0/desktop, gcc-4.6.3, glibc-2.15-r2, 3.5.0 x86_64)
=================================================================
System uname: Linux-3.5.0-x86_64-AMD_Phenom-tm-_9850_Quad-Core_Processor-with-gentoo-2.1
Timestamp of tree: Sat, 11 Aug 2012 06:30:01 +0000
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12
dev-lang/python:          2.6.8, 2.7.3-r2, 3.2.3-r1
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.27
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.10.5
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.6, 1.12.2
sys-devel/binutils:       2.22.90
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.5 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo gamerlay-stable funroll-loops overlay
Installed sets: @kde
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -msse4a -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -mtune=native -O2 -msse4a -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://gentoo.mneisen.org/ http://gentoo.supp.name/"
LANG="it_IT.utf8"
LC_ALL="it_IT.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="it en"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/gamerlay /var/lib/layman/funroll-loops /usr/overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 3dnowprefetch X a52 aac aalib acl acpi aim alsa amd64 amr amrnb amrwb apache2 apng ares asf ass audiofile avahi bash-completion berkdb bidi bl bluetooth branding bri bzip2 cairo caps cdda cdparanoia cdr cjk cli consolekit cracklib crypt cups curl cxx dba dbus declarative device-mapper dga dirac directfb divx divx4linux dri dts dv dvb dvd dvdnav dvdr dvdread edl embedded emboss enca encode ethereal exif expat faac faad fam fame fbcon ffmpeg fftw firefox flac fontconfig force-cgi-redirect fortran ftp garmin gd gdbm gif gimp gmedia gmp gnutls gpm gps gsm gtk iconv icq icu id3tag idn ifp ilbc imagemagick imap innodb ipod iproute2 ipv6 ithreads jabber java javascript jpeg kde kontact kvm ladspa lcms ldap libcaca libnotify libv4l2 live lm_sensors lua lvm lxc lzo mad maildir matroska mbox md5sum mdnsresponder-compat mhash mime mjpeg mmap mmx mmxext mng modules mozdevelop mozilla mp3 mp4 mpeg msn mtp mudflap multilib musepack mysql ncurses nemesi nepomuk network nfsv4 njb nls nptl nptlonly nsplugin numa nut nvidia offensive ofx ogg oggvorbis ogm openal openexr opengl openmp oscar pam pango parted pcap pcre pdf php plasma plotutils png pnm policykit ppds pppd pvr qemu qt3support qt4 radio rar readline rtc rtmp rtsp ruby samba sasl schroedinger sdl semantic-desktop session sha512 sl slang slp sms sndfile snmp sox speex spell srt sse sse2 sse4a ssh ssl startup-notification stream svg symlink taglib tcltk tcpd theora threads tiff tk tremor truetype udev udisks unicode upower usb utempter v4l v4l2 vcd vdpau vhosts videos vim-syntax virtualbox vorbis wmf wmp wxwidgets wxwindows x264 xanim xcb xface xft xine xml xosd xpm xscreensaver xsl xulrunner xv xvid xvmc yahoo zlib zoran zpm" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it en" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" SANE_BACKENDS="epjitsu epson epson2" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Andrew John Hughes 2012-08-15 10:20:35 UTC
Created attachment 321392 [details, diff]
Change MIB to mib to build with latest net-snmp

Attached patch corrects this issue.

The latest net-snmp defines MIB which is then used as a replacement in references to x->MIB in the apcupsd code.  Renaming the variable in apcupsd to mib (lowercase) fixes the issue.
Comment 2 Fabio Coatti 2012-08-15 15:20:09 UTC
Confirmed, with this patch acpucps builds with net-snmp 5.6.1 and works, thanks!
Comment 3 Billy DeVincentis 2012-08-23 11:20:18 UTC
Works for me
Comment 4 Juergen Rose 2012-08-26 07:05:18 UTC
The patch worked for me too (with net-snmp-5.7.2_rc1).
Comment 5 the_mgt 2012-09-17 19:18:49 UTC
Same here, recent stable gentoo-hardened profile, patch works for me.
Comment 6 Brandon Penglase 2012-09-30 02:28:26 UTC
Patch works here with net-snmp-5.7.2_rc1-r1.
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-11-16 16:26:24 UTC
*** Bug 443484 has been marked as a duplicate of this bug. ***
Comment 8 stathis 2012-12-02 23:13:30 UTC
It works for me too on x64 with net-snmp-5.7.2. 

probably it's stable enough for upstream?
Comment 9 Carlos Silva 2013-01-22 19:55:32 UTC
Just tested the patch, and it works.
Comment 10 Thomas Beutin 2013-01-26 09:36:50 UTC
compiles fine (using net-analyzer/net-snmp-5.7.2_rc1) for me
Comment 11 Wilson M. Michaels 2013-02-02 23:16:04 UTC
Compile is OK with sys-power/apcupsd-3.14.10-r1[nls usb -cgi -gnome -snmp].

Compile fails with sys-power/apcupsd-3.14.10-r1[nls usb -cgi -gnome snmp] on both ~x86 and ~amd64.

net-analyzer/net-snmp-5.7.2_rc1 is installed on both machines.

There is something wrong with the snmp code or header files within apcupsd.
Comment 12 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-09-11 12:08:15 UTC
*** Bug 481832 has been marked as a duplicate of this bug. ***
Comment 13 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-09-18 13:33:41 UTC
*** Bug 485300 has been marked as a duplicate of this bug. ***
Comment 14 Juergen Rose 2013-09-20 08:32:06 UTC
The patch worked also apcupsd-3.14.10-r2 and net-snmp-5.7.2. Why it is not added to the standard portage tree?
Comment 15 Matthew Marlowe (RETIRED) gentoo-dev 2013-10-21 22:07:37 UTC
Tentative fix included in 3.4.10-r5 which is now in CVS.
Comment 16 Camden Lindsay 2013-12-02 07:08:46 UTC
Regression?
This appears to be happening again with 3.14.8-r2
Same patch fixes the problem.
Comment 17 Olliver Schinagl 2014-03-04 20:49:43 UTC
Confirmed, -r2 breaks it again
Comment 18 Samuli Suominen (RETIRED) gentoo-dev 2014-03-04 20:56:55 UTC
(In reply to Camden Lindsay from comment #16)
> Regression?
> This appears to be happening again with 3.14.8-r2
> Same patch fixes the problem.

negative, the patch went in to apcupsd-3.14.10-r5, and is still present in -r6

obviously, -r2 is older than -r5 or -r6, so it's not an regression

newer version just needs stabilization, as in, install -r6, not -r2
Comment 19 Jeroen Roovers (RETIRED) gentoo-dev 2015-02-10 08:59:28 UTC
*** Bug 539548 has been marked as a duplicate of this bug. ***
Comment 20 deference 2016-04-13 04:48:43 UTC
I have this problem with -r2 too. I don't see an r5 or r6 ebuild available. Would you please fix this, it's been going on for *years* now.
BTW: 3.14.12-r1 does not suffer from this bug.