This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/23226] New: Nested function do not work on 32 bit build
- From: "lex dot augusteijn at philips dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2005 06:32:59 -0000
- Subject: [Bug c/23226] New: Nested function do not work on 32 bit build
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The nice litle program below does not work on 4.0.1 32 bit target code, running
on an Opteron.
The 64 bit target is OK.
The problem appears on both 3.4.3 and 4.0.1, I did not try other releases.
Regards,
Lex Augusteijn
----------------------------
#include <stdio.h>
typedef enum { FALSE, TRUE } Bool;
Bool false (int x) { return FALSE; }
void primes (int p, Bool (*filter) (int))
{
int q;
Bool my_filter (int x)
{
return x%p ? filter(x) : TRUE;
}
printf ("%d\n", p);
for (q = p+2; my_filter(q); q += 2) {}
primes (q, my_filter);
}
int main (void)
{
printf ("%d\n", 2);
primes (3, false);
return 0;
}
--
Summary: Nested function do not work on 32 bit build
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lex dot augusteijn at philips dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23226