News for hackers. Stuff that matters.
Re:Re: C as used/implemented in practice by pcwalton on Monday July 13, 2015 @08:59PM (#9882226)
The undefined behavior of C and C++ results in remote code execution to a degree completely unmatched by other languages.

Examples of dangerous UB in C always use deliberately sloppy code for pedagogical reasons. For real-world examples of problems, look at the CVE database.

Re:Re: C as used/implemented in practice by mcguire on Monday July 13, 2015 @11:40PM (#9882751)
How much of this is due to problems with C or C++, and how much is simply due to a lack of other languages for systems programming?

And yes, a major complaint of mine is using C or C++ when you don't absolutely have to.

Re:Re: C as used/implemented in practice by pjmlp on Tuesday July 14, 2015 @02:47AM (#9883223)
> How much of this is due to problems with C or C++, and how much is simply due to a lack of other languages for systems programming?

You mean lack of Algol, Mesa, Modula-2, Modula-3, Ada, Oberon, Oberon-2, Component Pascal, Object Pascal, Delphi, .... ?

C became ubiquous when UNIX got adopted as the enterprise OS, slowly replacing the mainframes.

Like JavaScript in browsers or Objective-C in iOS, targeting UNIX meant using C, back in the day companies would pay for UNIX SDKs.

No sane company would buy another compiler when they already had to pay for a C one, the official language.

The other OS vendors started to offer C compilers in their tools to ease the transition between the new UNIX workstations and their other OS.

So alternative saner systems programming languages wither way as C grew stronger and now we are with this problem.

Re:Re: C as used/implemented in practice by mcguire on Tuesday July 14, 2015 @12:48PM (#9886256)
"Lack of other languages" was poorly worded. I'm sorry.

What I meant was that, after the spread of Unix and C, C is the most common systems language in production. (Before the spread of C, I believe assembly was the most common systems language(s).)

I suspect that any systems language would have a bad reputation if it were used (and over-used) as much as C.

Re:Re: C as used/implemented in practice by ufo on Tuesday July 14, 2015 @12:33AM (#9882902)
Lots of languages around the time C came out had array bounds checks at runtime. C has a hard time doing that because of pointed and arrays being (mostly) interchangeable.