NetBSD Problem Report #48340
From rhialto@falu.nl Thu Oct 24 21:24:53 2013
Return-Path: <rhialto@falu.nl>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 1BFA1A5ABB
for <gnats-bugs@gnats.NetBSD.org>; Thu, 24 Oct 2013 21:24:53 +0000 (UTC)
Message-Id: <201310242124.r9OLOndE020794@murthe.falu.nl>
Date: Thu, 24 Oct 2013 23:24:49 +0200 (CEST)
From: rhialto@falu.nl
Reply-To: rhialto@falu.nl
To: gnats-bugs@gnats.NetBSD.org
Cc: rhialto@falu.nl
Subject: _POSIX_C_SOURCE or -posix and <net/bpf.h> don't mix
X-Send-Pr-Version: 3.95
>Number: 48340
>Category: kern
>Synopsis: _POSIX_C_SOURCE or -posix and <net/bpf.h> don't mix
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Oct 24 21:25:00 +0000 2013
>Last-Modified: Sat Nov 02 17:47:30 +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:/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.'
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: standards-manager->kern-bug-people
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sat, 02 Nov 2013 17:47:30 +0000
Responsible-Changed-Why:
not standards compliance (same situation as 48339)
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.