Ticket #344 (Invalid)Wed May 22 15:40:14 UTC 2013
Compiler reports id undefined when part of a #define
Reported by: | Matt (481) | Severity: | Minor |
Part: | RISC OS: C/C++ toolchain | Release: | |
Milestone: | Status | Invalid |
Details by Matt (481):
e.g
#define PRINT printf( (x)->id );
class MyClass
{
public:
int id;
};
// doesnt work with define here either
int main( void )
{
MyClass* c;
}
Will report back if/when checked pp output
Changelog:
Modified by Matt (481) Wed, May 22 2013 - 15:42:46 GMT
Code example came out funny. Will try again..
int main( void )
{
MyClass* c;
PRINT ; // Causes Error : ‘id undefined’
}
Modified by Matt (481) Wed, May 22 2013 - 15:45:08 GMT
grrr. one more try
int main(void)
{
MyClass* c;
PRINT; // causes ‘id undefined’
}
Modified by Matt (481) Wed, May 22 2013 - 15:47:42 GMT
i give up. PRINT should be passed the class. And also I should have put printf(“%d”, (x)->id ) alike stdio, but that’s irrelevant..
Modified by Sprow (202) Mon, May 27 2013 - 08:40:36 GMT
- Part changed from Unspecified to RISC OS: C/C++ toolchain
- Attachment added: test.cpp
The attached “test.cpp” worked for me, compiled using “c++ test” when placed in a directory called c++ as required.
Modified by Steve Revill (20) Wed, May 14 2014 - 20:34:49 GMT
- Status changed from Open to Invalid
Works for us. Closing as “not a bug”.