NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
standards/48340: _POSIX_C_SOURCE or -posix and <net/bpf.h> don't mix
>Number: 48340
>Category: standards
>Synopsis: _POSIX_C_SOURCE or -posix and <net/bpf.h> don't mix
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: standards-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Oct 24 21:25:00 +0000 2013
>Originator: Rhialto
>Release: NetBSD 6.1.1
>Organization:
>Environment:
System: NetBSD murthe.falu.nl 6.1.1 NetBSD 6.1.1 (MURTHE6.1.1) #4: Sat Sep 28
12:38:49 CEST 2013
rhialto%murthe.falu.nl@localhost:/usr/src/sys/arch/amd64/compile/MURTHE6.1.1
amd64
Architecture: x86_64
Machine: amd64
>Description:
The following little program does not compile:
$ cat b.c
#define _POSIX_C_SOURCE
#include <sys/types.h>
#include <net/bpf.h>
int main(int argc, char *argv[])
{
return 0;
}
$ gcc b.c
In file included from b.c:3:0:
/usr/include/net/bpf.h:51:15: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'bpf_u_int32'
/usr/include/net/bpf.h:72:2: error: expected specifier-qualifier-list before
'u_int'
/usr/include/net/bpf.h:90:2: error: expected specifier-qualifier-list before
'u_int'
/usr/include/net/bpf.h:106:2: error: expected specifier-qualifier-list before
'u_short'
In file included from b.c:3:0:
/usr/include/net/bpf.h:264:2: error: expected specifier-qualifier-list before
'u_char'
/usr/include/net/bpf.h:279:2: error: expected specifier-qualifier-list before
'u_int'
/usr/include/net/bpf.h:384:8: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'bpf_filter'
>How-To-Repeat:
See above.
If you remove the #define _POSIX_C_SOURCE, it compiles cleanly.
If you remove #define _POSIX_C_SOURCE but compile with
gcc -posix b.c
it fails too. I suppose -posix #defines _POSIX_C_SOURCE.
Analysis: see PR standards/48339 since it is essentially the same.
>Fix:
Similar to standards/48339, I imagine, which shows the same
problem in a different header file.
-Olaf.
--
___ Olaf 'Rhialto' Seibert -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl -- 'this bath is too hot.'
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index