[cfe-dev] graphviz problem

Zhongxing Xu xuzhongxing at gmail.com
Mon Nov 10 05:12:59 PST 2008


When running clang with the following command:

clang -checker-simple -analyzer-store-region -analyzer-viz-egraph-graphviz
example.c

on the following code:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

void write_file(int append) {
  char* tempname = 0;
  if (append == 1)
    tempname = "a";


  if (append == 1)
    open(tempname, O_RDONLY);
}

I got the following error:

ANALYZE: int.c write_file
Writing '/tmp/llvm_n297pA/GRExprEngine.dot'...  done.
Running 'dot' program... Error: Invalid 2-byte UTF8 found in input. Perhaps
"-Gcharset=latin1" is needed?
Error viewing graph: '

It seems that "a" is too short for 'dot'. When the string is "aa", "aap" is
printed in the generated PS graph. When the string is "aaa" or longer, 'dot'
works fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20081110/d1d7cb55/attachment.html>


More information about the cfe-dev mailing list