[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Having fun with the following C code (UB)



On Thu, 10 Apr 2014, Shachar Shemesh wrote:
> I never did understand what people expect. gcc uses the undefined

Warn the hell out of any line of code with per-spec undefined behaviour, if
not by default, at least under -Wall.

THAT would be a good start.  Too bad not even gcc knows every time it hits
undefined behaviour...

> Are you really sure you want to have slower code just so that your
> corner cases are easier for you? How is that a reasonable trade-off to make?

Yes in just about everything that did not ask for -On where n > 2.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


Reply to: