Bug 24611 - -Wunused-value Extension
Summary: -Wunused-value Extension
Status: RESOLVED DUPLICATE of bug 18624
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.1.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-01 10:55 UTC by Alexander J. Herrmann
Modified: 2005-11-01 14:22 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander J. Herrmann 2005-11-01 10:55:10 UTC
As a enhancement to the -Wunused-value which may allready detected by the data-flow analysis.
int problem_funktion(int a)
{
   int b = 0; // This should cause a warning as the value 0 is never used
   if (__builtin_expect(((a > 0) && ((b = 5) != 0)), 1))
   {
      return(a*b);
   }
   return(a);
} 
Compiling with -Wunused-value imo it should give me a warning about assigning a unused value to b.
Comment 1 Andrew Pinski 2005-11-01 14:22:15 UTC

*** This bug has been marked as a duplicate of 18624 ***