This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: different output from the gcc
- To: "Peter Kurpis" <pkurpis at keck dot hawaii dot edu>
- Subject: Re: different output from the gcc
- From: "Mahadev K Cholachagudda" <mahadev_kc at yahoo dot com>
- Date: Tue, 17 Oct 2000 08:45:38 +0530
- Cc: <gcc-help at gcc dot gnu dot org>
- References: <200010161611.GAA05042@kalani.keck.hawaii.edu>
----- Original Message -----
From: "Peter Kurpis" <pkurpis@keck.hawaii.edu>
To: <mahadev_kc@yahoo.com>
Cc: <gcc-help@gcc.gnu.org>
Sent: Monday, October 16, 2000 9:41 PM
Subject: Re: different output from the gcc
> > the following program prints different outputs on the terminal.
> >
> > #include <stdio.h>
> > int main()
> > {
> > int i=10, j=20;
> > printf("%d %d");
> > return 0;
> > }
> >
> >
> > on windows nt, prints : 38076236 1627415320
> > on RH linux , prints : 20 10
> > on sun solaris , prints : 67584 -1341572
>
> Are you sure you don't mean printf("%d %d", i, j) ?
Yes, It is only printf("%d %d");
>
> If you don't provide the arguments corresponding to
> the printf control string, printf just scoops up
> whatever happens to be on the stack, which is
> (expectedly) system dependant. Or am I missing
> something?
It may be a system dependent.
Is the gcc implements a different stack handling for the different OS. for
e.g x86 based win NT and Linux ?
With best regards,
mahadev
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com