Bug 50855

Summary: Bogus warning on weak symbol from g++
Product: [Retired] Red Hat Linux Reporter: hjl
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-08-17 16:49:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A patch none

Description hjl 2001-08-03 22:38:51 UTC
# 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 23:22:51 UTC
Created attachment 26172 [details]
A patch

Comment 2 Jakub Jelinek 2001-08-07 09:41:09 UTC
This will be included in gcc3-3.0-6 and gcc-2.96-96.
Thanks.

Comment 3 Jay Turner 2002-04-02 17:13:31 UTC
Fix confirmed with gcc-2.96-107.