Bug 8477 - <stdlib.h> missing prototypes with -DPOSIX_C_SOURCE=199506
Summary: <stdlib.h> missing prototypes with -DPOSIX_C_SOURCE=199506
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-01-14 20:17 UTC by Jay Turner
Modified: 2016-11-24 12:26 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-01-14 20:29:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Glen Foster 2000-01-14 20:17:21 UTC
VSX-PCTS finds a problem with <stdio.h> - similar to defect #8443 and
#8444.  The test expects to see functional prototypes for abort(), abs(),
and exit() when compiling with the following 2 option sets:

         (a) -DPOSIX_C_SOURCE=199506
         (b) -DPOSIX_C_SOURCE=199506 -DPOSIX_SOURCE

Appropriate lines from testing journal are as follows:
======================================================================
520|7 4 00002477 4 1|Feature test macros: -D_POSIX_C_SOURCE=199506
520|7 4 00002477 4 2|Compiler or run-time messages or results:
520|7 4 00002477 4 3|missing prototype for abort()
520|7 4 00002477 7 1|Feature test macros: -D_POSIX_C_SOURCE=199506
-D_POSIX_SOURCE
520|7 4 00002477 7 2|Compiler or run-time messages or results:
520|7 4 00002477 7 3|missing prototype for abort()
220|7 4 1 16:44:45|FAIL
200|7 5 16:44:45|TP Start
520|7 5 00002477 4 1|Feature test macros: -D_POSIX_C_SOURCE=199506
520|7 5 00002477 4 2|Compiler or run-time messages or results:
520|7 5 00002477 4 3|missing prototype for abs()
520|7 5 00002477 7 1|Feature test macros: -D_POSIX_C_SOURCE=199506
-D_POSIX_SOURCE
520|7 5 00002477 7 2|Compiler or run-time messages or results:
520|7 5 00002477 7 3|missing prototype for abs()

[snip] ... and later on says:

520|7 11 00002477 4 1|Feature test macros: -D_POSIX_C_SOURCE=199506
520|7 11 00002477 4 2|Compiler or run-time messages or results:
520|7 11 00002477 4 3|missing prototype for exit()
520|7 11 00002477 7 1|Feature test macros: -D_POSIX_C_SOURCE=199506
-D_POSIX_SOURCE
520|7 11 00002477 7 2|Compiler or run-time messages or results:
520|7 11 00002477 7 3|missing prototype for exit()

Comment 1 Cristian Gafton 2000-01-14 20:29:59 UTC
This stuff works for me:
alien (gafton):~/src/glibc/proto>cat proto.c
#define DPOSIX_C_SOURCE 199506
#include <stdlib.h>

alien (gafton):~/src/glibc/proto>gcc -E proto.c -c | grep "abort\|exit\|abs"
extern void abort  (void)     __attribute__ ((__noreturn__));
extern int atexit  (void (*__func) (void))    ;
extern int __on_exit  (void (*__func) (int __status, void *  __arg),
extern int on_exit  (void (*__func) (int __status, void *  __arg),
extern void exit  (int __status)     __attribute__ ((__noreturn__));
extern int abs  (int __x)     __attribute__ ((__const__));
extern long int labs  (long int __x)     __attribute__ ((__const__));


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