[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Strange problem - Pointer not null when declared

From: Gerard Marull Paretas
Subject: [avr-gcc-list] Strange problem - Pointer not null when declared
Date: Mon, 30 Jul 2007 01:00:05 +0200


I've been trying to find the reason of a curious bug, but I can't. It's so strange: I create a new structure that inside contains two pointers to other structures and one uint8_t. However, pointers are not NULL when created, so that makes my code to not work as it should. I've seen that when declaring that structure with static attribute all works fine (or making it global), pointers value is null when function starts. Creating the structure in other code part creates the same problem...

I really don't know what it can be... I attached the disassembly of the two code versions generated while debugging (with C source lines), one with static attribute and the other without.

Thanks for your help. Gerard.

Attachment: dis_with_static
Description: Binary data

Attachment: dis_without_static
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]