Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Return type of component main function (Rhapsody C)
Topic Summary:
Created On: 28-Feb-2007 12:51
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 28-Feb-2007 12:51
User is offline View Users Profile Print this message


Jens Konnertz

Posts: 10
Joined: 21-Feb-2007

Hello,

do anybody know how to change the return type of the component main function.

We like to have the following:

void main (void)
{
/* some code */
}

instead of:
int main (void)
{
/* some code */
return 0;
}

Thanks for your help.

Best regards
Jens Konnertz
Report this to a Moderator Report this to a Moderator
 2-Mar-2007 14:23
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Jens

You can change this for C++. (I haven't tried for C.) Take a look in the Rhapsody Properties reference, at the <lang>_CG::<Environment>::EntryPointDeclarationModifier property.

By default, the property only exists for the OsePPCDiab and OseSfk environments, but you can add it to any environment; copy the definition from the factoryC++.prp file and paste it in your siteC++.prp file under the appropriate metaclass.

Then, after reloading your model, you'll be able to set it as described in the Properties Reference.

best regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 6-Mar-2007 08:35
User is offline View Users Profile Print this message


Ian Turner

Posts: 25
Joined: 3-Feb-2006

Hi Simon,

yes this does work in C, but you have to modify the EntryPoint property as well. Insert the following into your environment properties file:

Property EntryPoint String "void"
Property EntryPointDeclarationModifier String "void main"

and this will generate the required main function declaration:

void main(void)

with no return statement in the body of the main function.

If you follow the properties help and set EntryPoint to "main" you will get:

void main(main)

Thanks for the tip!

Regards,

Ian
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.