开发者

Eclipse cdt is not giving enough information for error

  YYSTYPE yyvsa[YYINITDEPTH];
  YYSTYPE *yyvs = yyvsa;
  register YYSTYPE *yyvsp;

For the code above,it just reports:

Description Resource    Path    Location    Type
syntax e开发者_如何学Gorror before "yyvsa" yysphinxexpr.c  /sp/src line 852    C/C++ Problem

Which is far from useful,is it for configuration reasons?


That fragment looks reasonable. Whenever I run into an error message that doesn't make sense, I try to narrow it down using a process like the following:

  1. Verify that I can reproduce the error with as few dependencies as possible (e.g. removing unnecessary classes, includes, etc.)
  2. Compiling the file manually and seeing if the error is the same or is being interpreted before being displayed
  3. Preprocessing the file and then manually examining. Sometimes macros will stomp on themselves or do things you don't expect. If you can preprocess the file (e.g. gcc -E [opts] filename) you'll see what the compiler is ultimately processing, which may help.
  4. Trying with a different compiler. Sometimes a different compiler will produce an error message that makes more sense to you... or you'll find out that somebody did something that's only permitted by certain compilers.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜