Bug 22913 - gcc -traditional error on stdio.h
gcc -traditional error on stdio.h
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2000-12-27 21:06 EST by Itai Nahshon
Modified: 2007-04-18 12:30 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-12-27 21:06:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Itai Nahshon 2000-12-27 21:06:06 EST
This problem lives in glibc-2.2-9 and also in earlier versions.

gcc -traditional does not like these recursive macros
in <stdio.h>

/* C89/C99 say they're macros.  Make them happy.  */
#define stdin stdin
#define stdout stdout
#define stderr stderr

This results in a warning and the output is invalid C code.
Perhaps the above should be wraped with
   #if defined __STDC__ ... #endif

This is also the cause of warnings from /usr/X11R6/bin/makedepend .

BTW: cpp from gcc-2.96-69 does not define the macro __STDC_VERSION__ !!
(when -traditional is not set, 'info cpp' sais it should!), I think
that should be a separate bug report.
Comment 1 Jakub Jelinek 2001-01-11 17:57:41 EST
I've added #ifdef __STDC__ around these defines.
As for why __STDC_VERSION__ is not defined, info cpp is wrong about
this. __STDC_VERSION__ is defined in ISO C94 and above, and as default
is -std=gnu89, it should not be defined. It will be only if
you request -std=c94, -std=c99 or -std=gnu99.

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