This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/10813: Stack bug for functions with return value and parameter pointer
- From: powerstat at web dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 16 May 2003 04:15:39 -0000
- Subject: c/10813: Stack bug for functions with return value and parameter pointer
- Reply-to: powerstat at web dot de
>Number: 10813
>Category: c
>Synopsis: Stack bug for functions with return value and parameter pointer
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 16 04:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: powerstat@web.de
>Release: unknown-1.0
>Organization:
>Environment:
Windows 2000 with djgpp installation, gcc version 3.2.3
>Description:
The following (shortened) code:
#include <stdio.h>
unsigned short countFixDateInRange(unsigned short startday, unsigned short startmonth, long startyear, unsigned short endday, unsigned short endmonth, long endyear, unsigned short day, unsigned short month, long *const year)
{
*year = 2003;
return(0);
}
int main(void)
{
long year = -1;
unsigned short daycount = countFixDateInRange(startday,startmonth,startyear,endday,endmonth,endyear,1,5,&year);
printf("%hu\n",daycount);
printf("%ld\n",year);
}
this should output:
0
2003
but it shows me:
2003
2003
when I comment the "year" parameter out - the return value is correct. - Looks like a stack problem?
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: