Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32535 - /usr/include/sys/sysmacros.h causing compile failures
Summary: /usr/include/sys/sysmacros.h causing compile failures
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Please assign to toolchain
Depends on:
Blocks: 31307
  Show dependency tree
Reported: 2003-11-02 05:05 UTC by James Cloos
Modified: 2003-11-04 02:25 UTC (History)
0 users

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


Note You need to log in before you can comment on or make changes to this bug.
Description James Cloos 2003-11-02 05:05:08 UTC
ngrep wasn't merging; turned out its test for HAVE_DUMB_UDPHDR was giving a false positive.  Manually compiling the test .c from configure gives this:

:; gcc -O2 -c test.c 
In file included from /usr/include/sys/types.h:219,
                 from /usr/include/netinet/udp.h:52,
                 from test.c:10:
/usr/include/sys/sysmacros.h: In function `main':
/usr/include/sys/sysmacros.h:43: error: nested function `gnu_dev_major' declared `extern'
/usr/include/sys/sysmacros.h:49: error: nested function `gnu_dev_minor' declared `extern'
/usr/include/sys/sysmacros.h:55: error: nested function `gnu_dev_makedev' declared `extern'

So, it looks like gcc-3.3.2-r2 doesn't like nested extern functions, and glibc-2.3.2-r8 contains some in /usr/include/sys/sysmacros.h.
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-02 11:12:42 UTC
ngrep works here with those.  Please attach your test.c, and output of 'make
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-02 11:15:10 UTC
Err, scratch that.
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-02 11:20:52 UTC
Did gcc-3.3.1-r* work fine with this ?
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-02 14:20:39 UTC
The test is wrong, and should look as follows:

#line 1765 "configure"
#include "confdefs.h"
#ifndef __FAVOR_BSD
#define __FAVOR_BSD
#ifndef _BSD_SOURCE
#define _BSD_SOURCE 1
#include <netinet/udp.h>
int main() {
struct udphdr foo;
unsigned short bar = foo.uh_sport;
; return 0; }

(note the #include, etc OUTSIDE main() ).

Fixed in CVS.
Comment 5 James Cloos 2003-11-02 14:44:41 UTC
Good catch; i must get blind shortly before crashing for the night ... (day?)

ngrep's says:

#ifndef __FAVOR_BSD
#define __FAVOR_BSD

#ifndef _BSD_SOURCE
#define _BSD_SOURCE 1

#include <netinet/udp.h>

struct udphdr foo;
unsigned short bar = foo.uh_sport;
        echo nope,
        echo yep dumb; AC_DEFINE(HAVE_DUMB_UDPHDR))

nb the comma on the line w/ AC_TRY_COMPILE.  That is the bug.
remove that comma and the configure works.

diff is:
--- a/        2003-11-02 17:41:32.780242175 -0500
+++ b/        2003-11-02 17:41:45.266929980 -0500
@@ -179,7 +179,7 @@
        AC_MSG_CHECKING(for a dumb udphdr declaration)
-       AC_TRY_COMPILE(,
 #ifndef __FAVOR_BSD
 #define __FAVOR_BSD


but the autoconf must be re-run...
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-02 14:55:24 UTC
Mind passing it on to the ngrep guys ?
Comment 8 Joshua Kinard gentoo-dev 2003-11-04 02:25:49 UTC