Bug 185932 - When compiling with --std=c99, drand48 is not in stdlib.h
When compiling with --std=c99, drand48 is not in stdlib.h
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-19 21:03 EST by Horst H. von Brand
Modified: 2007-11-30 17:11 EST (History)
0 users

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


Attachments (Terms of Use)
A little test program (61 bytes, text/plain)
2006-03-19 21:03 EST, Horst H. von Brand
no flags Details

  None (edit)
Description Horst H. von Brand 2006-03-19 21:03:35 EST
Description of problem:
Compiling a program using drand48(3) it is not declared, but withhout it there
are no complaints.

Version-Release number of selected component (if applicable):
glibc-2.4-4, gcc-4.1.0-3

How reproducible:
Always

Steps to Reproduce:
1. Compile program given below with "gcc --std=c99 -c tst.c"
2.
3.
  
Actual results:
tst.c: In function ‘tst’:
tst.c:5: warning: implicit declaration of function ‘drand48’

Expected results:
No warnings

Additional info:
Comment 1 Horst H. von Brand 2006-03-19 21:03:39 EST
Created attachment 126331 [details]
A little test program
Comment 2 Jakub Jelinek 2006-03-20 10:38:54 EST
That's correct, <stdlib.h> header content is mandated by ISO C99, and drand48
is not an ISO C99 function.
Please read
info libc 'Feature Test Macros'
for details.  E.g. -std=gnu99 instead of -std=c99, or -std=c99 -D_GNU_SOURCE,
-std=c99 -D_XOPEN_SOURCE=600 and several other switches will provide the drand48
prototype.

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