News for hackers. Stuff that matters.
Re:A semantic model for a substantial fragment of C by zodiac on Saturday April 01, 2017 @04:19AM (#14011144)
> You are correct to note that the programming language I'm describing does not perfectly conform to any of the documents that are ever called a "C standard". But that programming language is central to our computing infrastructure

I don't agree with this. Yes, people often write code that unintentionally rely on UB/implementation-specific behavior; but are there important projects that do this intentionally? In any case, compiler authors are going to follow the C standards, not you hypothetical "C-in-practice" standards, so what good does it do to for formalize or clearly specify the latter?

Re:A semantic model for a substantial fragment of C by laughinghan on Saturday April 01, 2017 @04:21PM (#14013965)
> are there important projects that do this intentionally?

Expecting integer overflow to be two's complement is so common that successors like Java, Go, and Rust all standardized on it, used by hashing algorithms and more: https://github.com/rust-lang/rfcs/pull/560

> In any case, compiler authors are going to follow the C standards, not you hypothetical "C-in-practice" standards

"The optimizer does go to some effort to "do the right thing" when it is obvious what the programmer meant (such as code that does "* (int *)P" when P is a pointer to float)." --blogpost by the second most widely used C compiler, clang/llvm: http://blog.llvm.org/2011/05/what-every-c-programmer-should-...

Re:A semantic model for a substantial fragment of C by greglindahl on Saturday April 01, 2017 @04:33PM (#14014024)
Unsigned integers in C have defined wrap and that is what portable hash functions use.
Re:A semantic model for a substantial fragment of C by naasking on Saturday April 01, 2017 @10:09AM (#14012177)
> I don't agree with this. Yes, people often write code that unintentionally rely on UB/implementation-specific behavior; but are there important projects that do this intentionally?

The Linux kernel.

Re:A semantic model for a substantial fragment of C by gravypod on Saturday April 01, 2017 @10:24AM (#14012242)
I thought staging was the only folder with UB code.
Re:A semantic model for a substantial fragment of C by naasking on Saturday April 01, 2017 @11:13AM (#14012502)
So then the Linux kernel is exactly a big and important project that intentionally depends upon UB, which is what you asked for right?
Re:A semantic model for a substantial fragment of C by zodiac on Thursday April 06, 2017 @04:39AM (#14048901)
Where do they do it?