On Friday, 5 February 2016 at 00:03:20 UTC, tsbockman wrote:
If the same `extern(C)` symbol is declared multiple places in the D source code for a program, the compiler should issue at least a warning if the D signatures don't agree with each other.

I guess D could do it, although this is a rather unlikely source for bugs.

C cannot do it. It would be annoying as declarations are file local.

C doesn't really build programs, it builds object files that are linked into a program.

It makes perfect sense for one compilation unit to type a parameter pointer to float and another unit to type the same parameter as a simd-array of floats. The underlying code could be machine language. And in machine language there are no types (on current CPUs), only bit patterns. So you can have multiple reasonable interpretations of the same machine language entry.

A type is a constraint, but it isn't a property of the actual bits, it is a language specific interpretation.

Reply via email to