Bug 493159 - #include <math.h> has no prototype for lrint as man 3 lrint says it should.
#include <math.h> has no prototype for lrint as man 3 lrint says it should.
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
10
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-31 16:05 EDT by Edward J. Huff
Modified: 2009-03-31 16:20 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-03-31 16:20:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Edward J. Huff 2009-03-31 16:05:34 EDT
Description of problem:

#include <math.h> has no prototype for lrint as man 3 lrint says it should.

Version-Release number of selected component (if applicable):

$ rpm -qf /usr/share/man/man3/lrint.3.gz 
man-pages-3.09-2.fc10.noarch
$ rpm -qf /usr/include/math.h
glibc-headers-2.9-3.i386

How reproducible:  Duh...

Steps to Reproduce:
1. grep lrint /usr/include/math.h
2. zgrep include /usr/share/man/man3/lrint.3.gz
3.
  
Actual results:
$ grep lrint /usr/include/math.h /usr/include/tgmath.h
/usr/include/tgmath.h:#define lrint(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long int, lrint)
/usr/include/tgmath.h:#define llrint(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long long int, llrint)
$ zgrep include /usr/share/man/man3/lrint.3.gz
.B #include <math.h>

Expected results:

Either man 3 lrint mentions <tgmath.h> or <math.h> somehow defines lrint.

Additional info:
Comment 1 Jakub Jelinek 2009-03-31 16:20:31 EDT
grep is obviously not the method you should use to find prototypes in headers.
Anyway, lrint is an ISO C99 function, it didn't exist in ISO C89, so the prototype is only available if you compile with one of -std=c99, -std=gnu99, -D_ISOC99_SOURCE, -D_POSIX_C_SOURCE=200112L, -D_POSIX_C_SOURCE=200809L,
-D_XOPEN_SOURCE=600, -D_XOPEN_SOURCE=700 or -D_GNU_SOURCE.
See
info libc 'Feature Test Macros'

Note You need to log in before you can comment on or make changes to this bug.