Bug 185932 - When compiling with --std=c99, drand48 is not in stdlib.h
Summary: When compiling with --std=c99, drand48 is not in stdlib.h
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-20 02:03 UTC by Horst H. von Brand
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-03-20 15:38:54 UTC
Type: ---
Embargoed:


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

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.


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