Bug 8477 - <stdlib.h> missing prototypes with -DPOSIX_C_SOURCE=199506
<stdlib.h> missing prototypes with -DPOSIX_C_SOURCE=199506
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Cristian Gafton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-01-14 15:17 EST by Jay Turner
Modified: 2016-11-24 07:26 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-14 15:29:41 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)

  None (edit)
Description Glen Foster 2000-01-14 15:17:21 EST
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 15:29:59 EST
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.