Bug 50855 - Bogus warning on weak symbol from g++
Bogus warning on weak symbol from g++
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-03 18:38 EDT by hjl
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-17 12:49:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
A patch (569 bytes, patch)
2001-08-03 19:22 EDT, hjl
no flags Details | Diff

  None (edit)
Description hjl 2001-08-03 18:38:51 EDT
# cat x.c
extern void foo (void) __attribute__ ((weak));

int
main ()
{
  if (&foo)
    foo ();

  return 0;
}
# g++ -S -O -Wall x.c
x.c: In function `int main ()':
x.c:6: warning: the address of `foo ()', will always be `true'

gcc is ok. gcc 3.0 has the same bug.
Comment 1 hjl 2001-08-03 19:22:51 EDT
Created attachment 26172 [details]
A patch
Comment 2 Jakub Jelinek 2001-08-07 05:41:09 EDT
This will be included in gcc3-3.0-6 and gcc-2.96-96.
Thanks.
Comment 3 Jay Turner 2002-04-02 12:13:31 EST
Fix confirmed with gcc-2.96-107.

Note You need to log in before you can comment on or make changes to this bug.