From nobody@FreeBSD.org  Mon Feb 25 13:27:32 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 7493F37B402
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 25 Feb 2002 13:27:31 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g1PLRVU53282;
	Mon, 25 Feb 2002 13:27:31 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200202252127.g1PLRVU53282@freefall.freebsd.org>
Date: Mon, 25 Feb 2002 13:27:31 -0800 (PST)
From: Thomas Pornin <pornin@bolet.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: standard include files do not comply to standards
X-Send-Pr-Version: www-1.0

>Number:         35321
>Category:       bin
>Synopsis:       standard include files do not comply to standards
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 25 13:30:01 PST 2002
>Closed-Date:    Mon Jun 24 06:25:24 PDT 2002
>Last-Modified:  Mon Jun 24 06:25:24 PDT 2002
>Originator:     Thomas Pornin
>Release:        4.5-PRERELEASE
>Organization:
NONE
>Environment:
FreeBSD nostromo.bolet.org 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #0: Sat Dec 22 09:18:15 CET 2001 root@nostromo.bolet.org:/usr/src/sys/compile/NOSTROMO  i386

>Description:
/usr/include/machine/ansi.h contains the following line:

typedef __signed char              __int8_t;

The `__signed' is recognized by gcc as an alternate name for `signed'
but is not standard. /usr/include/sys/cdefs.h contains some macros
that map `__signed' to `signed' or nothing depending on the value of
__STDC__. But some include files include <machine/ansi.h> and not
<sys/cdefs.h>, or include both in the wrong order (<sys/cdefs.h> after
<machine/ansi.h>).

Affected files are:
<err.h>
<inttypes.h>
<netdb.h>
<stddef.h>
<string.h>
<syslog.h>
<time.h>
<vis.h>
<sys/dirent.h>
<sys/inttypes.h>
<sys/queue.h>
<sys/syslog.h>
<sys/times.h>

At least for <inttypes.h>, <stddef.h>, <string.h> and <time.h>, this
is contrary to ISO 9899:1999, aka the C standard, which specifies
(in 7.1.2/4) that "standard headers may be included in any order".

>How-To-Repeat:
Preprocess the following one-line code with `gcc -E' or another
standard preprocessor:

#include <stddef.h>

you will find in the output the faulty declaration with `__signed'.

>Fix:
Fix the above-stated include files to include <sys/cdefs.h> before
<machine/ansi.h>.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dwmalone 
State-Changed-When: Mon Jun 24 06:24:47 PDT 2002 
State-Changed-Why:  
Duplicate of http://www.FreeBSD.org/cgi/query-pr.cgi?pr=35307 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35321 
>Unformatted:
