Bug 3739 - GCC preprocessor bug
GCC preprocessor bug
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
6.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Cristian Gafton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-06-25 19:21 EDT by brownb
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-06-26 10:30:22 EDT
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 brownb 1999-06-25 19:21:21 EDT
The following program will not compile when I use the "-O"
switch:

#include <stdio.h>
#include <string.h>

int main()
{
	char *foo;

	foo = strdup("lslsjflsdjf"
#ifdef foobar
			"lskjflsjfl"
#endif
			"hello world");
}

Here is the compiler output I get:

egret [266]  egcs foo.c -o foo -O
foo.c:12: warning: preprocessing directive not recognized
within macro arg
foo.c:12: warning: preprocessing directive not recognized
within macro arg
foo.c:12: warning: preprocessing directive not recognized
within macro arg
foo.c:12: warning: preprocessing directive not recognized
within macro arg
foo.c:12: warning: preprocessing directive not recognized
within macro arg
foo.c:12: warning: preprocessing directive not recognized
within macro arg
foo.c: In function `main':
foo.c:9: undefined or invalid # directive
foo.c:11: undefined or invalid # directive
foo.c:12: parse error before `#'
foo.c:12: parse error before `#'
foo.c:12: parse error before `#'
foo.c:12: parse error before `#'
foo.c:12: parse error before `#'
foo.c:12: parse error before `#'
Comment 1 Jeff Johnson 1999-06-26 10:29:59 EDT
This is a problem with glibc, not gcc so I'm changing the
component.

Most string functions are now implemented as preprocessor
macros. That means that the construct (from nmh, right :-)
is no longer valid. Change the scope of the ifdef to include
the strdup to fix.


------- Email Received From  "Robert E. Brown" <brownb@jany.gs.com> 06/26/99 20:00 -------

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