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.
-- Summary: -Wunused-value Extension Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: alexander_herrmann at yahoo dot com dot au http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24611