Bug 185932

Summary: When compiling with --std=c99, drand48 is not in stdlib.h
Product: [Fedora] Fedora Reporter: Horst H. von Brand <vonbrand>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-20 15:38:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A little test program none

Description Horst H. von Brand 2006-03-20 02:03:35 UTC
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-20 02:03:39 UTC
Created attachment 126331 [details]
A little test program

Comment 2 Jakub Jelinek 2006-03-20 15:38:54 UTC
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.