Are the critiques in "All the things I hate about Python" valid?

Chris Angelico rosuav at gmail.com
Mon Feb 19 05:09:25 EST 2018


On Mon, Feb 19, 2018 at 9:04 PM, Alain Ketterlin
<alain at universite-de-strasbourg.fr.invalid> wrote:
> Chris Angelico <rosuav at gmail.com> writes:
>
>> On Mon, Feb 19, 2018 at 7:40 PM, Alain Ketterlin
>> <alain at universite-de-strasbourg.fr.invalid> wrote:
>
>>> No. C has much stronger rules, not on casting, but on accessing the
>>> pointees, which basically invalidates your argument. Refer to the C
>>> standard for details.
>>
>> Really? What rules?
>
> Look at the C11 standard, section 6.3.2.3 ("Pointers"), 6.5.§6-7
> ("effective types"), and 6.5.3.2 ("Address and indirection operators").
> It is tiring to constantly correct misunderstandings about pointer
> casting and dereferencing.
>
>> $ cat demo.c; gcc -Wall demo.c; ./a.out
> [...]
>
> If you don't know what undefined behavior is, better avoid C. Your
> program has UB, anything can happen, including a seemingly sensible
> result.

Sure it can. But I don't know what you can mean by "stronger rules" if
all it says is "that's undefined". Saying that behaviour is undefined
does NOT mean that C has a stronger type system. I got no errors, not
even a warning in -Wall mode, so there is no indication that my code
did something wrong.



More information about the Python-list mailing list