Re:Null Pointer Dereferencing Causes Undefined Behavior
by kragen on Tuesday April 21, 2015 @12:04PM
(#9414979)
Your suggestion is ridiculous. First, it wouldn’t be enough to stop using C; I would also have to stop using software written in C. And C++. Second, there aren’t any reasonable alternatives to C — it’s not the only portable low-level language, but it’s the only popular one, other than C++, which shares the same problems.
Re:Null Pointer Dereferencing Causes Undefined Behavior
by mpweiher on Tuesday April 21, 2015 @09:07AM
(#9413736)
I've been using C since before there even was a standard. Why should I ditch the language because <deleted> have hijacked the language spec?
Re:Null Pointer Dereferencing Causes Undefined Behavior
by lmm on Tuesday April 21, 2015 @09:52AM
(#9413973)
Because they're the ones who the language is valuable to. You have plenty of other options; they don't.
Re:Null Pointer Dereferencing Causes Undefined Behavior
by mpweiher on Tuesday April 21, 2015 @02:47PM
(#9416109)
For the sorts of semantics they are looking for, FORTRAN seems to be a good option. Or keep the crazy in C++ land?
What are my options if I want a simple, easy to understand language that is close to the execution model of current machines?
Re:Null Pointer Dereferencing Causes Undefined Behavior
by makomk on Tuesday April 21, 2015 @01:37PM
(#9415670)
No, it wasn't written for that purpose at all. Many of these undefined behaviours exist in the spec because long ago, there was some exotic architecture where doing that thing caused a hardware exception or behaved strangely. For instance, on some systems that are no longer in use, trying to obtain the pointer in this example would cause an access violation and abort the program because pointer calculations are checked in hardware. It was never intended as an excuse for compiler writers to randomly decide to be dicks.
Re:Null Pointer Dereferencing Causes Undefined Behavior
by kragen on Tuesday April 21, 2015 @04:03PM
(#9416655)
There’s that, and then there’s also long-ago exotic architectures where you weren’t processing untrusted data, you really did care about improving your performance by ½%, and it really was worth the massive amount of programmer time needed to debug the resulting problems. There’s a famous apocryphal quote that writing C for the Cray (?) compiler was like “writing to [the programmer’s] ex-wife’s lawyer”.
Also, there are still Unisys Clearpath/MCP systems in use.
Yes it was. Or at least, that's the constituency C currently has - and understandably C continues to serve it. There needs to be a language for that kind of people, and that language is C.
If you don't want that, stop using C. It's not hard.