NetBSD Problem Report #53393

From www@NetBSD.org  Sun Jun 24 20:26:44 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7A5157A187
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 24 Jun 2018 20:26:44 +0000 (UTC)
Message-Id: <20180624202643.38CB77A280@mollari.NetBSD.org>
Date: Sun, 24 Jun 2018 20:26:43 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: rint isn't visible in some circumstances
X-Send-Pr-Version: www-1.0

>Number:         53393
>Category:       standards
>Synopsis:       rint isn't visible in some circumstances
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 24 20:30:00 +0000 2018
>Closed-Date:    Mon Jun 25 00:28:57 +0000 2018
>Last-Modified:  Mon Jun 25 00:28:57 +0000 2018
>Originator:     coypu
>Release:        NetBSD 8.99.19
>Organization:
>Environment:
NetBSD planets 8.99.19 NetBSD 8.99.19 (GENERIC) #0: Sat Jun 23 06:52:51 IDT 2018  fly@planets:/tmp/build/sys/arch/amd64/compile/GENERIC amd64

>Description:
fly@planets ~> cat test.c
#define _POSIX_C_SOURCE 200112L
#include <math.h>

int main() {
	double x = 1.2;
	(void)rint(x);
	return 0;
}


fly@planets ~> gcc test.c -lm
test.c: In function ‘main’:
test.c:6:8: warning: implicit declaration of function ‘rint’ [-Wimplicit-function-declaration]
  (void)rint(x);
        ^~~~
test.c:6:8: warning: incompatible implicit declaration of built-in function ‘rint’
test.c:6:8: note: include ‘<math.h>’ or provide a declaration of ‘rint’



rint is standard C, so I think it shouldn't warn.
>How-To-Repeat:
Build pkgsrc/graphics/babl, get warning from gggl.c, investigate.
>Fix:

>Release-Note:

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: standards/53393: rint isn't visible in some circumstances
Date: Sun, 24 Jun 2018 20:39:51 +0000

 Apparently of this block:

 #if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
 double  acosh(double);
 double  asinh(double);
 double  atanh(double);
 double  cbrt(double);
 double  expm1(double);
 int     ilogb(double);
 double  log1p(double);
 double  logb(double);
 double  nextafter(double, double);
 double  remainder(double, double);
 double  rint(double);
 double  scalb(double, double);
 #endif /* (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)*/
 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */


 scalb is the only one that needs to remain out.

 the others are available since C99 and some POSIX incantation.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53393 CVS commit: src/include
Date: Sun, 24 Jun 2018 18:07:47 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Sun Jun 24 22:07:47 UTC 2018

 Modified Files:
 	src/include: math.h

 Log Message:
 PR/53393: coypu: move rint to the right section.


 To generate a diff of this commit:
 cvs rdiff -u -r1.63 -r1.64 src/include/math.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 25 Jun 2018 00:28:57 +0000
State-Changed-Why:
All the functions mentioned in this bug report are now visible under C99 following xtos's work.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.