Subject: lib/9052: cc(1) can't compile a file using only.
To: None <gnats-bugs@gnats.netbsd.org>
From: Takahiro Kambe <taca@sky.yamashina.kyoto.jp>
List: netbsd-bugs
Date: 12/25/1999 02:21:39
>Number:         9052
>Category:       lib
>Synopsis:       cc(1) can't compile a file using <math.h> only.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 25 02:20:58 1999
>Last-Modified:
>Originator:     Takahiro Kambe
>Organization:
	
>Release:        NetBSD-current 1999/12/24
>Environment:
	
System: NetBSD edge.sky.yamashina.kyoto.jp 1.4P NetBSD 1.4P (CF-M33) #69: Sat Dec 25 12:39:01 JST 1999 taca@edge.sky.yamashina.kyoto.jp:/usr/src/sys/arch/i386/compile/CF-M33 i386


>Description:
	cc(1) can't compile a file using <math.h> only.
>How-To-Repeat:
o Sample file, sample.c:

#include <math.h>

double
a(n)
	double n;
{
	return sqrt(n);
}

o Compile result:

% cc -traditional -fno-builtin -c sample.c
taca@edge[65]:cc -traditional -fno-builtin -c sample.c 
In file included from /usr/include/math.h:22,
                 from sample.c:1:
/usr/include/machine/math.h:8: syntax error before `char'
In file included from sample.c:1:
/usr/include/math.h:27: syntax error before `char'
/usr/include/machine/math.h:8: warning: array `__nanf' assumed to have one element
/usr/include/math.h:27: warning: array `__infinity' assumed to have one element


>Fix:
	Include <sys/cdefs.h> somewhere in <math.h> with checking
	definition of _SYS_CDEFS_H_.

	The same problem may exist in other header files.

>Audit-Trail:
>Unformatted: