From owner-freebsd-standards@FreeBSD.ORG Mon May 4 11:29:18 2009 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D1E910656D3 for ; Mon, 4 May 2009 11:29:18 +0000 (UTC) (envelope-from octo@verplant.org) Received: from huhu.verplant.org (verplant.org [IPv6:2001:780:0:1e::1]) by mx1.freebsd.org (Postfix) with ESMTP id 05D328FC12 for ; Mon, 4 May 2009 11:29:17 +0000 (UTC) (envelope-from octo@verplant.org) Received: from octo by huhu.verplant.org with local (Exim 4.63) (envelope-from ) id 1M0wMG-0003id-JQ; Mon, 04 May 2009 13:29:16 +0200 Date: Mon, 4 May 2009 13:29:16 +0200 From: Florian Forster To: freebsd-standards@freebsd.org Message-ID: <20090504112916.GI25815@verplant.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1R7yw+ZU6pp3P8Kk" Content-Disposition: inline X-Pgp-Fingerprint: E7F2 3FEC B693 9F6F 9B77 ACF6 8EF9 1EF5 9152 3C3D X-Pgp-Public-Key: http://verplant.org/pubkey.txt User-Agent: Mutt/1.5.13 (2006-08-11) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: isnan(3) not available in C99/POSIX2001 mode X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2009 11:29:19 -0000 --1R7yw+ZU6pp3P8Kk Content-Type: multipart/mixed; boundary="86AcgArEE8aDdRDK" Content-Disposition: inline --86AcgArEE8aDdRDK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I'm having problems compiling a C99 program and I believe this to be a problem in FreeBSD's libc. In the macro `isnan' is defined. The macro checks the size of its argument to determine whether it's a float, double, or long double and calls `isnanf', `isnan', or `__isnanl' respectively. The problem is that the `isnan' macro is defined if `__ISO_C_VISIBLE >=3D 1999' but `isnanf' is only declared if `__BSD_VISIBLE' is defined. In my case (C99 and POSIX 2001 requested) this results in a syntax error: (The file `c99_nan.c' is attached.) [octo@collectd ~]$ c99 -D_POSIX_C_SOURCE=3D200112L -o c99_nan c99_nan.c=20 c99_nan.c: In function 'main': c99_nan.c:21: warning: implicit declaration of function 'isnanf' I was able to reproduce the problem on the following systems: - FreeBSD *** 7.0-STABLE FreeBSD 7.0-STABLE #3: Tue Jun 24 12:35:54 CEST 2= 008 ***:/usr/obj/usr/src/sys/SEHRKERN2 i386 - FreeBSD *** 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1 14:37:25 UTC = 2009 ***:/usr/obj/usr/src/sys/GENERIC i386 The version information in /usr/include/math.h is: - $FreeBSD: src/lib/msun/src/math.h,v 1.62 2007/01/07 07:54:21 das Exp $ - $FreeBSD: src/lib/msun/src/math.h,v 1.62.6.1 2008/11/25 02:59:29 kensmit= h Exp $ The `c99' binary refused to give out any version information, but the installed version of GCC is 4.2.1 20070719. Using `gcc -std=3Dc99' does not result in different behavior from using `c99' as far as the syntax error is concerned. A quick search at did not yield any related bug reports. Please CC me on replies =E2=80=93 I'm not subscribed to this list. Regards, -octo --=20 Florian octo Forster Hacker in training GnuPG: 0x91523C3D http://verplant.org/ --86AcgArEE8aDdRDK-- --1R7yw+ZU6pp3P8Kk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFJ/tGMHdggu3Q05IYRAticAJ4+5/WIRKd5qqZNkmKi8U4PmdpV6ACgkT/N ZsldVi9kR5jss06T0qDVNPw= =VP74 -----END PGP SIGNATURE----- --1R7yw+ZU6pp3P8Kk--