Hi
foo should get declared on the stack, naybe your stack address is pointing
to ROM instead of RAM?
Regards
Mat
----- Original Message -----
From: "Xyrus" <sfreeman@...>
To: <gbadev@egroups.com>
Sent: Tuesday, October 03, 2000 4:39 PM
Subject: [gbadev] Compiler issues
> Hi guys,
> I seem to be having some issues with the gcc compiler. It doesn't like
> complex structures for some reason. Here's an example of what I'm talking
> about:
>
> typedef struct{
> float stuff;
> int morestuff[5];
> }MYSTUFF;
>
> typedef struct{
> MYSTUFF crap[2];
> float morecrap;
> }CRAPOLA;
>
>
> Now, if I try to use the above inside of a function:
>
> void Trash()
> {
> CRAPOLA foo;
> foo.morecrap = 5;
> }
>
> The code compiles, but it makes foo into a rom address (verified through
the
> debugger). Obviously the code doesn't work :). Now I know that if you
> initialize a variable to a value (a global) or use static, it assigns the
> variable to a rom address, but does the same thing happen with structs? It
> seems that some structs work and others don't. Why?
>
> I think I'll just go back to doing everything in assembly. :)
>
> Just Me,
> *SF
>
>
>
>
>
> unsubscribe: gbadev-unsubscribe@egroups.com
>
>
>