This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++-2.95.2 on HP-UX 11.00: return value of main()
- To: Jeffrey A Law <law at cygnus dot com>
- Subject: Re: g++-2.95.2 on HP-UX 11.00: return value of main()
- From: "Ulrich Windl" <Ulrich dot Windl at rz dot uni-regensburg dot de>
- Date: Wed, 19 Apr 2000 08:05:01 +0200
- CC: bug-gcc at gnu dot org
- Organization: Universitaet Regensburg, Klinikum
- References: Your message of 14 Apr 2000 09:54:32 -0300. <orya6gj113.fsf@zecarneiro.lsd.ic.unicamp.br>
On 18 Apr 00, at 4:17, Jeffrey A Law wrote:
>
> In message <orya6gj113.fsf@zecarneiro.lsd.ic.unicamp.br>you write:
> > On Apr 14, 2000, "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de> wrote:
> >
> > > So we can say the ANSI standard says it (returning exitcodes from
> > > main()) should work?
> >
> > Yep. It's expected to work. It's probably a HP-UX 11-specific bug.
> > One of the issues that needed porting, that hadn't been done by the
> > time GCC 2.95 was released.
> While hpux11 is not supported in gcc-2.95, this bug sounds like it would
> not be hpux11 specific.
I have not studied the internals, but I can imagine that either the C
library or the C++ library is responsible for passing the return
value of main() to the calling environment. However if it works for
HP-C and HP-C++ it might still be a bug in gcc/g++.
I made a test on the machine where I compiled the binary:
rkdvmhp3:windl(23) % cc e.c
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (e.o) was
detected. T
he linked output may not run on a PA 1.x system.
rkdvmhp3:windl(24) % a.out
rkdvmhp3:windl(25) % echo $status
11
rkdvmhp3:windl(26) % cat e.c
int main()
{
return 11;
}
Unfortunately I have no gdb to disassemble here.
Regards,
Ulrich