This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25954] New: external variable address assumed not to be zero
- From: "frederic dot petrot at lip6 dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2006 06:16:45 -0000
- Subject: [Bug c/25954] New: external variable address assumed not to be zero
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Tested on gcc 4.0.2 20050808 and gcc 4.0.3 20051013
I don't know if this is a bug or a feature : this code, also
compiled without optimization, doesn't check if the address of
the variable is zero.
extern unsigned long int __spm_addr;
int main(void)
{
return &__spm_addr ? __spm_addr + 1 : -1;
}
gcc 3.x checks the variable address.
--
Summary: external variable address assumed not to be zero
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: frederic dot petrot at lip6 dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25954