OpenQNX :: The QNX Community Portal

Aug 21, 2008 - 06:24 AM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 42 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
dominix
Post subject: GCC on qnx4 : bad return code  PostPosted: Jul 06, 2007 - 08:28 PM
Guest





hello all.

On my way to send my data to a Database, I'm tring to compile
different products and I have a strange problem with gcc.

I have watcom 10.6 that run fine
I have installed gcc from JC michelot site
gcc281-qnx4-r19 : gcc is required to compile some product.
(I just untared it) it seems to work cause it compile fine.

my problem is : when I compile some test program the return
code is not the rigth one.

for ex:
# cat hello.c
main() {
return 0;
}
# gcc hello.c -o hello
# ./hello ; echo $?
148
#

the same process with wcc produce a return code of 0

any idea of what went wrong ?
thanks for your advices.

--
dominix
 
   
Reply with quote Back to top
maschoen
Post subject: RE: GCC on qnx4 : bad return code  PostPosted: Jul 08, 2007 - 06:52 AM
QNX Master


Joined: Jun 25, 2003
Posts: 1058

Try instead of "return 0", "exit(0)". If this works, then there is a library problem.
main() is not usually the actual entry point for a 'C' program, just a routine called
by the initialization code. The return from main() should be sent to exit(), and
maybe it is not.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
dominix
Post subject: Re: GCC on qnx4 : bad return code  PostPosted: Jul 09, 2007 - 07:00 PM
Guest





"maschoen" <maschoen@pobox-dot-com.no-spam.invalid> a écrit dans le message
de news: f6q4te$2jk$1@inn.qnx.com...
Quote:
Try instead of "return 0", "exit(0)". If this
works, then there is a library problem.
main() is not usually the actual entry point for a 'C' program, just a
routine called
by the initialization code. The return from main() should be sent to
exit(), and
maybe it is not.


I was missing watcom c++.
it is required to make gcc works.
thanks for pointing this.

Dx
 
   
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.