On 26/07/2011 19:08, Walter Bright wrote:
It's not a bug in dmc. The code is quite deliberate and necessary. The
bug is in clang.

$ cat test.c
#include <stdint.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
    uint64_t value = atoi(argv[0]);
    if ((unsigned short)value != value)
    {
        return 0;
    }
    return 1;
}
$ scan-build clang -g test.c

Note that this leads to no errors from the analyzer - it will only flag it if it knows statically whether value fits within an unsigned short or not. We'll see if it's still flagged when I re-run it.

--
Robert
http://octarineparrot.com/

Reply via email to