RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Previous|Next

  • Tickets
  • » Ticket #344

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;

PRINT; // Causes Error : ‘id undefined’ printf( c->id ); // ok

}

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”.

  • Comment on, or change status of, this ticket

Previous|Next

Search tickets

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Options

  • Tickets
  • New ticket
  • Milestones
  • Subversion: Changesets
  • Subversion: Browse
  • CVS: Revisions
  • CVS: Browse
  • Search

RSS feeds Rss

  • Tickets
  • Everything!
  • More feeds...
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Collaboa theme is distantly based on the Collaboa default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Collaboa
This site runs on Rails

Hosted by Arachsys