Clang error recovery

Walter Bright newshound1 at digitalmars.com
Tue Apr 6 15:04:43 PDT 2010


bearophile wrote:
> Clang:
> 
> 
> #include <inttypes.h>
> int64 x;
> 
> 
> t.c:2:1: error: unknown type name 'int64'; did you mean 'int64_t'?
> int64 x;
> ^~~~~
> int64_t
> 
> -----------------
> 
> dmd:
> 
> I am not sure if this is the same situation:
> 
> alias uint uint64_t;
> int foo(uint64 x) {
>   return x * 2;
> }
> void main() {}
> 
> 
> dmd prints:
> 
> temp.d(2): Error: identifier 'uint64' is not defined

dmd's spell checker only looks a distance of one, and uint64 is a distance of 
two from uint64_t. This is trivially changed, but I didn't do the longer 
distances because of the annoyances of false positives - variable name spelling 
doesn't work like english language spelling.

The issue is not, as has been suggested, that dmd doesn't do spelling checks on 
types.

There's really nothing "amazing" about a spell checker, it's just a better idea 
than not doing it.



More information about the Digitalmars-d mailing list