Content deleted Content added
→Trusting internal data validity: Optimizing compilers are (too) smart |
|||
Line 63:
}
return "black"; // To be handled as a dead traffic light.
// Waring: This last 'return' statement will be dropped by an optimizing
// compiler if all possible values of 'traffic_light_color' are listed in
// the previous 'switch' statement...
}
</syntaxhighlight>
Line 75 ⟶ 78:
}
assert(0); // Assert that this section is unreachable.
// Waring: This 'assert' function call will be dropped by an optimizing
// compiler if all possible values of 'traffic_light_color' are listed in
// the previous 'switch' statement...
}
</syntaxhighlight>
|