Undefined behaviour in C [was Re: The Cost of Dynamism]

Rustom Mody rustompmody at gmail.com
Sun Mar 27 03:52:04 EDT 2016


On Sunday, March 27, 2016 at 1:10:51 PM UTC+5:30, Steven D'Aprano wrote:
> On Sun, 27 Mar 2016 05:13 pm, Paul Rubin wrote:
> 
> > No it's not meaningless if it "might" overflow, it's meaningless if it
> > -does- overflow, 
> 
> No! That's exactly wrong!
> 
> Paul, thank you for inadvertently proving the point I am trying to get
> across. People, even experienced C coders, simply don't understand what the
> C standard says and what C compilers can and will do.

Yeah this misunderstanding is a deep one
People find it hard to get the halting problem:

for(;;)
  ;
is an infinite loop.
Whats the big deal?
Why is it 'impossible' to detect?

Its hard because we have to reason all possible inputs (and for language
implementations, all possible programs) when these are yet unavailable
unwritten

JFTR I am not remotely arguing that C is not dangerous.
http://blog.languager.org/2013/02/c-in-education-and-software-engineering.html
It was bad in 1991 and has probably got worse with a totally networked world
of nameless hoods.

I am just saying no-C is no-option
[Considering the day it is you may wish to consider prayer :-) ]



More information about the Python-list mailing list