Question about __attribute__((weak)) behavior

Mark E. snowball3@usa.net
Tue Jan 5 09:46:00 GMT 1999


When compiling a file containing only:
__attribute__ ((weak)) int x;

with a version of egcs 1.1.1 for DJGPP modified for weak symbol 
support, I get different output when compiled in C and C++. Here's 
the 
output:

test1.s from test1.c:

.file	"test1.c"
.comm _x,4


test1.s from test1.cpp:

.file	"test1.cpp"
.weak	_x
.data
	.p2align 2
_x:
	.space 4

Is the difference between the C and C++ intended or have I found 
a 
bug?

Mark

--- 
Mark Elbrecht snowball3@usa.net
http://members.xoom.com/snowball3/



More information about the Gcc-bugs mailing list