From owner-freebsd-bugs@FreeBSD.ORG Tue Jul 8 21:23:26 2014 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFBDC3DD for ; Tue, 8 Jul 2014 21:23:26 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6C98231B for ; Tue, 8 Jul 2014 21:23:26 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s68LNQvK096205 for ; Tue, 8 Jul 2014 22:23:26 +0100 (BST) (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 191754] New: *l(3) math functions are not declared properly in math.h Date: Tue, 08 Jul 2014 21:23:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: yaneurabeya@gmail.com X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 21:23:26 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191754 Bug ID: 191754 Summary: *l(3) math functions are not declared properly in math.h Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: Needs Triage Severity: Affects Some People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: yaneurabeya@gmail.com POSIX claims that powl(3) should be defined via math.h/libm ( http://pubs.opengroup.org/onlinepubs/9699919799/functions/pow.html) with std=c99, but unfortunately this appears to be broken on FreeBSD 10-STABLE/11-CURRENT. If I remove the "#if _DECLARE_C99_LDBL_MATH" guard from math.h, things compile more cleanly (it just emits a warning about loss in precision because of the imprecise functions). This guard should probably have a !defined(__cplusplus) check added to it. Before: % clang -std=iso9899:1999 -lm -o /root/powl_undeclared /root/powl_undeclared.c /root/powl_undeclared.c:9:41: warning: implicitly declaring library function 'powl' with type 'long double (long double, long double)' printf("powl(%Lf, %Lf) = %Lf\n", a, b, powl(a, b)); ^ /root/powl_undeclared.c:9:41: note: please include the header or explicitly provide a declaration for 'powl' 1 warning generated. /tmp/powl_undeclared-252fa5.o: In function `main': /root/powl_undeclared.c:(.text+0x4e): warning: powl has lower than advertised precision % gcc -std=c99 -lm -o /root/powl_undeclared /root/powl_undeclared.c /root/powl_undeclared.c: In function 'main': /root/powl_undeclared.c:9: warning: implicit declaration of function 'powl' /root/powl_undeclared.c:9: warning: incompatible implicit declaration of built-in function 'powl' /tmp//ccSJGxdD.o: In function `main': powl_undeclared.c:(.text+0x54): warning: powl has lower than advertised precision % gcc46 -std=c99 -lm -o /root/powl_undeclared /root/powl_undeclared.c /root/powl_undeclared.c: In function 'main': /root/powl_undeclared.c:9:2: warning: implicit declaration of function 'powl' [-Wimplicit-function-declaration] /root/powl_undeclared.c:9:41: warning: incompatible implicit declaration of built-in function 'powl' [enabled by default] /tmp//ccmC02s8.o: In function `main': powl_undeclared.c:(.text+0x54): warning: powl has lower than advertised precision % gcc -std=iso9899:1999 -lm -o /root/powl_undeclared /root/powl_undeclared.c /root/powl_undeclared.c: In function 'main': /root/powl_undeclared.c:9: warning: implicit declaration of function 'powl' /root/powl_undeclared.c:9: warning: incompatible implicit declaration of built-in function 'powl' /tmp//ccGtRDWg.o: In function `main': powl_undeclared.c:(.text+0x54): warning: powl has lower than advertised precision % gcc46 -std=iso9899:1999 -lm -o /root/powl_undeclared /root/powl_undeclared.c /root/powl_undeclared.c: In function 'main': /root/powl_undeclared.c:9:2: warning: implicit declaration of function 'powl' [-Wimplicit-function-declaration] /root/powl_undeclared.c:9:41: warning: incompatible implicit declaration of built-in function 'powl' [enabled by default] /tmp//ccjUVEX8.o: In function `main': powl_undeclared.c:(.text+0x54): warning: powl has lower than advertised precision After: % gcc46 -std=iso9899:1999 -lm -o /root/powl_undeclared /root/powl_undeclared.c /tmp//ccMsjZpJ.o: In function `main': powl_undeclared.c:(.text+0x54): warning: powl has lower than advertised precision % clang -std=iso9899:1999 -lm -o /root/powl_undeclared /root/powl_undeclared.c /tmp/powl_undeclared-ed9797.o: In function `main': /root/powl_undeclared.c:(.text+0x4e): warning: powl has lower than advertised precision % gcc -std=iso9899:1999 -lm -o /root/powl_undeclared /root/powl_undeclared.c /tmp//ccFvfEeJ.o: In function `main': powl_undeclared.c:(.text+0x54): warning: powl has lower than advertised precision -- You are receiving this mail because: You are the assignee for the bug.