Bugs item #1116802, was opened at 2005-02-05 12:40
Message generated for change (Comment added) made by tecodev
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1116802&group_id=599
Category: C Preprocessor
>Group: fixed
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Raphael Neider (tecodev)
Summary: Incorrect partial _Pragma("x") Implementation
Initial Comment:
First _Pragma gets partially replace
totally chokes on following
>cat pragma.c
#define XY(x,y) _Pragma("save") _Pragma("less-pedantic") if(y)x() _Pragma("restore")
__VERSION__
XY(0,foo);
>cpp pragma.c
# 1 "pragma.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "pragma.c"
"3.4.2 [FreeBSD] 20040728"
# 3 "pragma.c"
#pragma save
# 3 "pragma.c"
# 3 "pragma.c"
#pragma less-pedantic
# 3 "pragma.c"
if(foo)0()
# 3 "pragma.c"
#pragma restore
# 3 "pragma.c"
;
>sdcpp pragma.c
# 2 "pragma.c"
"3.1 20010625 (experimental) + SDCC"
#pragma _Pragma("less-pedantic") if(foo)0() _Pragma("restore")save
# 3 "pragma.c"
;
till
(riedelATtecoDOTedu)
----------------------------------------------------------------------
>Comment By: Raphael Neider (tecodev)
Date: 2005-05-14 12:18
Message:
Logged In: YES
user_id=1115835
Fixed in #1024, though #line directives should be emitted to
compensate for the added lines...
----------------------------------------------------------------------
Comment By: Raphael Neider (tecodev)
Date: 2005-04-29 20:00
Message:
Logged In: YES
user_id=1115835
I have prepared a fix for this -- to be committed after
2.5.0 is out.
Unfortunately it does not fulfill the intended use, as
"#pragma restore" restores the more-pedantic setting before
the code is analyzed. One would have to delay the
restore'ation to after the function body...
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2005-02-05 13:11
Message:
Logged In: NO
please ignore the actual macro (should have been if(x)y() instead)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1116802&group_id=599
|