------- Additional Comments From joseph at codesourcery dot com 2004-11-24 01:40 ------- Subject: Re: [3.3/3.4/4.0 regression] #pragma weak problem
On Wed, 24 Nov 2004, pinskia at gcc dot gnu dot org wrote: > JSM did you read what RTH wrote? What RTH wrote was discussing the over-simplified testcase #pragma weak bar = foo with nothing else in the source file. If you read the bug description and not just the oversimplified testcase, the salient feature is that bar is undeclared. But what makes that translation unit useless is that it doesn't define foo - not that it doesn't declare bar. Consider the two translation units (1) #pragma weak bar void bar(void); int main(void) { bar(); return 0; } (2) #pragma weak bar = foo void foo(void) {} You can compile and link them together. With 2.95.x and 3.0.x, bar is a weak alias to foo and the program executes successfully. With later versions, bar is an undefined weak symbol and so the program dumps core. Think about bugs before closing them just because of a comment about a single testcase that doesn't cover all issues described in the bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7544