Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 394633 - sys-apps/usbutils-005 fails to build: UINT_MAX undeclared in usbhid-dump.c
Summary: sys-apps/usbutils-005 fails to build: UINT_MAX undeclared in usbhid-dump.c
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-14 04:06 UTC by Alexandre Rostovtsev (RETIRED)
Modified: 2011-12-14 17:22 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to #include <limits.h> (usbutils-005-limits.h.patch,664 bytes, patch)
2011-12-14 04:06 UTC, Alexandre Rostovtsev (RETIRED)
Details | Diff
emerge --info (emerge-info.txt,16.52 KB, text/plain)
2011-12-14 04:10 UTC, Alexandre Rostovtsev (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-12-14 04:06:04 UTC
Created attachment 295745 [details, diff]
patch to #include <limits.h>

# USE="-network-cron -python -zlib" emerge usbutils
[...]
make[4]: Entering directory `/var/tmp/portage/sys-apps/usbutils-005/work/usbutils-005/usbhid-dump/src'
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..   -I/var/tmp/portage/sys-apps/usbutils-005/work/usbutils-005/usbhid-dump -I/var/tmp/portage/sys-apps/usbutils-005/work/usbutils-005/usbhid-dump/include -D_GNU_SOURCE -DNDEBUG   -Os -Wall -march=native -O2 -pipe -c usbhid-dump.c
usbhid-dump.c: In function ‘parse_timeout’:
usbhid-dump.c:764:60: error: ‘UINT_MAX’ undeclared (first use in this function)
usbhid-dump.c:764:60: note: each undeclared identifier is reported only once for each function it appears in
usbhid-dump.c: In function ‘dump’:
usbhid-dump.c:156:15: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Wunused-result]
make[4]: *** [usbhid-dump.o] Error 1

The build failure occurs both with USE="zlib -network-cron -python" and USE="-network-cron -python -zlib".

The obvious solution is to #include <limits.h> in usbhid-dump.c; the patch is attached, and it allows me to build usbutils-005. I have submitted the patch upstream to https://sourceforge.net/tracker/?func=detail&aid=3459209&group_id=233297&atid=1089171 (note that usbhid-dump has a separate upstream from usbutils, and is included in usbutils as a git submodule).
Comment 1 Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-12-14 04:10:37 UTC
Created attachment 295747 [details]
emerge --info
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2011-12-14 17:22:18 UTC
looks like Debian had same patch, but also stddef.h was missing in another file, so:

+  14 Dec 2011; Samuli Suominen <ssuominen@gentoo.org> usbutils-005.ebuild,
+  +files/usbutils-005-missing-includes.patch:
+  Fix missing limits.h and stddef.h wrt #394633 by Alexandre Rostovtsev. This
+  is Debian patch 04-missing-includes.diff.

thanks again