Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6509190
Votes 0
Synopsis Sun Studio Express (Dec 06) preprocessor bug
Category c++:preproc
Reported Against
Release Fixed mars_dev(39)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6509309
Submit Date 03-JAN-2007
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
_Pragma prevents preprocessing of the remainder of the line

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile this code:

#define NOT_A_TOKEN
int oops() _Pragma("foo") NOT_A_TOKEN;


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the code should compile, because NOT_A_TOKEN should be preprocessed away
ACTUAL -
 ~etp% sunc++ oops.cpp
"oops.cpp", line 2: Error: "{" expected instead of "NOT_A_TOKEN".
"oops.cpp", line 2: Error: NOT_A_TOKEN is not defined.
"oops.cpp", line 2: Error: "}" expected instead of EOF.
3 Error(s) detected.


ERROR MESSAGES/STACK TRACES THAT OCCUR :
see above

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
#define NOT_A_TOKEN
int oops() _Pragma("foo") NOT_A_TOKEN;
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
change the whitespace so that the next token is on another line

#define NOT_A_TOKEN
int oops() _Pragma("foo")
     NOT_A_TOKEN;
Posted Date : 2007-01-03 15:27:31.0
Work Around
N/A
Evaluation
Verified in latest 5.9 compiler.
Posted Date : 2007-01-03 15:28:26.0

A macro at the end of _Pragma is not expanded.
In do_macro_expr(), if the token after a _Pragma is an ident,
perform macro expansion.
File modified: pragmas.cc
Posted Date : 2007-01-09 00:12:53.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang