Book a Demo

Author Topic: Cannot reverse C++ var args list (...)  (Read 3428 times)

clearwa

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Cannot reverse C++ var args list (...)
« on: August 06, 2008, 12:34:44 am »
The following error

There was an error parsing E:\Perforce\depot\branches\logging\legacy\ccs\rtp\NamedChannels\SRCS\Debug.h on line 69.  Unexpected symbol: .      

appears when I attempt to reverse engineer a C++ header where a method's argument list contains an ellipsis, ie. variable argument notation.  Is this a known problem?  Is there a workaround?

Thanx,
Allan Clearwaters

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Cannot reverse C++ var args list (...)
« Reply #1 on: August 06, 2008, 03:26:17 am »
If you don't hear back from the other forum users I suggest you send the header file and error message to Sparx support. You'll find their email address at the top of the Support page - just click the Support link near the top or bottom of any forum page.
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Cannot reverse C++ var args list (...)
« Reply #2 on: August 06, 2008, 08:24:17 am »
EA can import var arg lists from C++, although I am aware that it doesn't round trip well.

It's likely there's something else going on, so it's probably best to send an email with some sample code to Sparx Systems.

clearwa

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Cannot reverse C++ var args list (...)
« Reply #3 on: August 06, 2008, 05:52:39 pm »
Was a simple problem - no comma in the function argument list.  For example, EA will barf on

func1( char * tt ... )

although the compiler (g++)  happily accepts it.  EA wants

func1( char * tt, ... )

Sigh....
Al

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Cannot reverse C++ var args list (...)
« Reply #4 on: August 06, 2008, 10:12:19 pm »
Thanks Al,

Although g++ does take it, omitting the comma is against the 'rules' the rest of us live by. Given that EA is not a compiler and must try to understand what code 'should' mean, the current behavior is correct.

Thanks for pointing this one out. Others could easily stumble over it, and the root problem can be pretty subtle in a complex system.

David
No, you can't have it!