2 msgFailed build of AVR cross-compiler with combine...
2 msgunwind problem when cross compiling
1 msgvoli low cost
1 msgfluupe
4 msgSoft float support and casting
1 msgcompiling errors with options '-fprofile-arcs -...
8 msgUnclear documentation on building GCC together ...
8 msgalloca attribute?
3 msgchanges made to gmon-sol2.c not reflected after...
2 msgCompiling error when changing to gcc4.1.1
1 msgenums, switches, and warnings?
1 msgException stack too large
5 msgprefetching on pentium 4
2 msgHow, i can work with read-rtl.c
5 msggcc for ppc
2 msgDifferent versions created executable's compati...
2 msgEasy linker problem

A bug with variables and functions of the same ...
\ darby johnston (28 Nov 2006)
. \ Ian Lance Taylor (28 Nov 2006)

1 msgTracking operator ==
2 msggcc 3.0 and linux kernel
Subject:A bug with variables and functions of the same name?
Group:Gcc-help
From:darby johnston
Date:28 Nov 2006


Hi,

Found something sort of odd:

int a(int);

int main(int, char **)
{
int a = a(100);
return 0;
}

> g++ -Wall -o foo foo.cxx
foo.cxx: In function ‘int main(int, char**)’:
foo.cxx:7: error: ‘a’ cannot be used as a function

That seems normal, but add a "const" to the above:

const int a = a(100);

And it compiles without any errors (and even links
ok). I made this simple test case from a bug I found
in my code, which even stranger, emitted warnings
like:

warning: ‘retval.170’ is used uninitialized in this
function

Of course, I don't have any variables named
"retval.170". Is this a bug with gcc?

gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

Thanks for any help!



© 2004-2008 readlist.com