From owner-freebsd-bugs Fri Feb 27 02:20:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA00867 for freebsd-bugs-outgoing; Fri, 27 Feb 1998 02:20:05 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA00835; Fri, 27 Feb 1998 02:20:03 -0800 (PST) (envelope-from gnats) Received: from vanuata (vanuata.dcs.gla.ac.uk [130.209.240.50]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA00624 for ; Fri, 27 Feb 1998 02:16:57 -0800 (PST) (envelope-from simonm@dcs.gla.ac.uk) Received: from solander.dcs.gla.ac.uk (actually host solander) by vanuata with SMTP (MMTA) with ESMTP; Fri, 27 Feb 1998 10:16:15 +0000 Received: (from simonm@localhost) by solander.dcs.gla.ac.uk (8.8.7/8.8.7) id KAA07921; Fri, 27 Feb 1998 10:16:11 GMT Message-Id: <199802271016.KAA07921@solander.dcs.gla.ac.uk> Date: Fri, 27 Feb 1998 10:16:11 GMT From: Simon Marlow Reply-To: Simon Marlow To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/5866: /usr/include/sys/time.h and _POSIX_SOURCE don't mix Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 5866 >Category: bin >Synopsis: can't include with _POSIX_SOURCE defined >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 27 02:20:01 PST 1998 >Last-Modified: >Originator: Simon Marlow >Organization: University of Glasgow >Release: FreeBSD 3.0-CURRENT (25 Feb) >Environment: 3.0-CURRENT only, stable doesn't have this problem. >Description: uses some types from which aren't defined under _POSIX_SOURCE, and doesn't protect the relevant sections with #ifndef _POSIX_SOURCE. >How-To-Repeat: $ cat >test.c #define _POSIX_SOURCE #include ^D $ gcc test.c In file included from test.c:2: /usr/include/sys/time.h:120: parse error before `timecounter_get_t' /usr/include/sys/time.h:120: warning: data definition has no type or storage class /usr/include/sys/time.h:125: parse error before `timecounter_get_t' /usr/include/sys/time.h:125: warning: no semicolon at end of struct or union /usr/include/sys/time.h:142: parse error before `}' >Fix: I don't have access to the POSIX spec, so I have no idea what the right thing to do is. Here's a guess: *** time.h~ Wed Feb 25 16:47:38 1998 --- time.h Fri Feb 27 10:02:46 1998 *************** *** 116,121 **** --- 116,123 ---- * called attoseconds, it comes from "atten" for 18 in Danish/Swedish. */ + #ifndef _POSIX_SOURCE + struct timecounter; typedef u_int timecounter_get_t __P((struct timecounter *)); typedef u_int64_t timecounter_delta_t __P((void)); *************** *** 140,145 **** --- 142,148 ---- struct timecounter *other; struct timecounter *tweak; }; + #endif /* !_POSIX_SOURCE */ /* Operations on timevals. */ #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message