Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-06-2004, 09:29 AM   #1
LQ Newbie
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
gcc bug?

I made the following program and get an error line10 when compiling with
gcc 3.3.2.

#define DEF1

#ifdef DEF1

printf("Hello world");

"DEF1 must be defined
DEF1 must be defined"
#endif /* DEF1 */

Bit strange to have a compilation error here since DEF1 is defined.
If I remove both " after #else it's Ok. Also if I remove the \n at the end
of DEF1 must be defined.

Seems like a preprocessor bug, isn't it?

Old 02-06-2004, 10:45 AM   #2
jim mcnamara
Registered: May 2002
Posts: 964

Rep: Reputation: 34
"DEF1 must be defined  \
DEF1 must be defined"
#endif /* DEF1 */
Plus, cpp (the preprocessor) expects valid stuff in there, not just an
improperly terminated string.
Old 02-07-2004, 08:44 AM   #3
LQ Newbie
Registered: Feb 2004
Posts: 2

Original Poster
Rep: Reputation: 0

Thanks but actually my question is is it a bug of this gcc version?
Because I do not have this error with other gcc versions.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bug reports on glibc or gcc tvburger Linux From Scratch 1 12-06-2004 01:43 AM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 03:13 PM
Free86 bug or nVidia bug?? ProtoformX Linux - Software 2 05-12-2004 03:38 AM
Extremely strange bug in gcc/g++ Maidros Linux - Software 3 05-08-2004 07:28 AM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 01:07 AM

All times are GMT -5. The time now is 03:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration