![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
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 |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.