Great talk, and I found it really interesting and enjoyable to read! I generally wonder about the omission of modern compilers from talking about C's features. Yes, as a language the typing is all crap, but in practice implementations can be more aggressive about type checking, etc. And C++ in particular is not as content with treating enums as just plain integers — using enums as integers in C or C++ can lead to very awful pain and should usually be avoided, IM!HO.
Which, with the default Clang setup on Mac OS X, no additional warning flags, yields:
x.cc:4:7: warning: case value not in enumerated type 'Foo' [-Wswitch]
case 30:
^
x.cc:3:10: warning: enumeration values 'Cock' and 'Dong' not handled in switch [-Wswitch]
switch (x) {
^
2 warnings generated.
So, yes, the language isn't offering guarantees there as such, and some of them are there if you want them (and I can't imagine not turning on the vast majority of warnings and treating them as errors.)
(no subject)
Date: 2013-06-20 02:54 am (UTC)(no subject)
From:(no subject)
Date: 2013-06-20 06:22 am (UTC)For instance:
Which, with the default Clang setup on Mac OS X, no additional warning flags, yields:
So, yes, the language isn't offering guarantees there as such, and some of them are there if you want them (and I can't imagine not turning on the vast majority of warnings and treating them as errors.)
(no subject)
From:(no subject)
Date: 2013-06-21 06:24 am (UTC)pp. 8, 45: If you have the whole program and monomorphize, like MLton does, you don't have to box everything.
(no subject)
From: