http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52654
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-04-06 CC| |manu at gcc dot gnu.org Ever Confirmed|0 |1 --- Comment #12 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-06 11:45:43 UTC --- (In reply to comment #10) > I made the warnings on by default. Any opinion on whether I should have made > them depend on OPT_Woverflow instead? > > I guess I thought the warning is slightly different in this case than the case > of just a regular numeric literal because the warning might cause the > programmer to examine a different type of operator as a solution - say > template > or raw. > Some comments: * Is overflow anything but -1, 0, and 1? If so, could you just make it an enum? This will have the added benefit of not making calls like whatever(...,0,...) in which it is very far from clear what 0 means. With the enum you can use "NO_OVERFLOW". It may also save some space with respect to using 'int'. * I don't get the reasoning for not using OPT_Woverflow. It is a warning about overflow of numbers. Adding warnings that cannot be disabled by any option is bad. The warning could be moved to a new different option later if people clamor for it. * Please use warning_at, even if you don't have a better location than input_location. Diagnostic functions without location are DEPRECATED, but nobody has bothered to do a full-conversion of the existing ones (I did with pedwarn, inform and permerror, but there are too many warning/error calls).