Makopo / lslint

lslint is a tool to check the syntactic and semantic validity of Second Life LSL scripts.
http://w-hat.com/lslint
32 stars 15 forks source link

clangd output for v1.0.9 #72

Closed buildersbrewery closed 6 years ago

buildersbrewery commented 6 years ago

Posting below an output for lslint v1.0.9 via:

Hope this helps with further development.


 ◌ ast.hh:
       68:25    None            error       use of undeclared identifier 'NULL'
       68:45    None            error       use of undeclared identifier 'NULL'
       68:67    None            error       use of undeclared identifier 'NULL'
       68:83    None            error       use of undeclared identifier 'NULL'
       68:97    None            error       use of undeclared identifier 'NULL'
       68:109   None            error       use of undeclared identifier 'NULL'
       68:121   None            error       use of undeclared identifier 'NULL'
       70:15    None            error       use of undeclared identifier 'NULL'
       70:35    None            error       use of undeclared identifier 'NULL'
       70:57    None            error       use of undeclared identifier 'NULL'
       70:73    None            error       use of undeclared identifier 'NULL'
       70:87    None            error       use of undeclared identifier 'NULL'
       70:99    None            error       use of undeclared identifier 'NULL'
       70:111   None            error       use of undeclared identifier 'NULL'
       78:39    None            error       use of undeclared identifier 'NULL'
       78:59    None            error       use of undeclared identifier 'NULL'
       78:81    None            error       use of undeclared identifier 'NULL'
       78:97    None            error       use of undeclared identifier 'NULL'
       78:111   None            error       use of undeclared identifier 'NULL'

 ◌ builtins.cc:
        1:11    None            error       'stdio.h' file not found
        7:24    None            error       use of undeclared identifier 'NULL'
       22:6     None            error       use of undeclared identifier 'NULL'
       26:38    None            error       use of undeclared identifier 'NULL'
       27:13    None            error       use of undeclared identifier 'strcmp'
       30:13    None            error       use of undeclared identifier 'stderr'
       31:10    None            error       use of undeclared identifier 'EXIT_FAILURE'
       36:32    None            error       use of undeclared identifier 'NULL'
       37:5     None            error       unknown type name 'FILE'
       37:16    None            error       use of undeclared identifier 'NULL'
       40:22    None            error       use of undeclared identifier 'NULL'
       41:18    None            error       use of undeclared identifier 'NULL'
       42:19    None            error       use of undeclared identifier 'NULL'
       42:34    None            error       use of undeclared identifier 'NULL'
       45:25    None            error       use of undeclared identifier 'NULL'
       48:16    None            error       use of undeclared identifier 'NULL'
       50:11    None            error       use of undeclared identifier 'perror'
       51:16    None            error       use of undeclared identifier 'EXIT_FAILURE'
       57:37    None            error       use of undeclared identifier 'NULL'
       60:35    None            error       use of undeclared identifier 'NULL'

 ◌ final_walk.cc:
       47:29    None            error       use of undeclared identifier 'NULL'
       51:29    None            error       use of undeclared identifier 'NULL'
       62:40    None            error       use of undeclared identifier 'NULL'
      140:23    None            error       use of undeclared identifier 'NULL'
      150:13    None            error       use of undeclared identifier 'strcmp'
      160:29    None            error       use of undeclared identifier 'NULL'
      164:29    None            error       use of undeclared identifier 'NULL'
      175:37    None            error       use of undeclared identifier 'NULL'
      175:64    None            error       use of undeclared identifier 'NULL'
      192:32    None            error       use of undeclared identifier 'NULL'
      195:41    None            error       use of undeclared identifier 'NULL'
      208:65    None            error       use of undeclared identifier 'NULL'
      211:39    None            error       use of undeclared identifier 'NULL'
      230:47    None            error       use of undeclared identifier 'EQ'
      238:109   None            error       use of undeclared identifier 'EQ'

 ◌ location.hh:
       29:12    None            error       'iostream' file not found
      110:11    None            error       use of undeclared identifier 'std'
      110:37    None            error       use of undeclared identifier 'std'

 ◌ logger.cc:
        2:11    None            error       'stdlib.h' file not found
        9:29    None            error       use of undeclared identifier 'NULL'
       13:22    None            error       use of undeclared identifier 'NULL'
       46:14    None            error       use of undeclared identifier 'sprintf'
       55:10    None            error       use of undeclared identifier 'std'
       64:14    None            error       use of undeclared identifier 'sprintf'
       75:20    None            warning     passing an object that undergoes default argument promotion to 'va_start' has undefined behavior
       25:48    None            info        parameter of type 'ErrorCode' is declared here
       90:30    None            error       use of undeclared identifier 'NULL'
       97:37    None            error       use of undeclared identifier 'NULL'
      124:11    None            error       use of undeclared identifier 'vsprintf'
      130:18    None            error       use of undeclared identifier 'stdout'
      135:22    None            error       use of undeclared identifier 'NULL'
      137:14    None            error       use of undeclared identifier 'sprintf'
      140:20    None            error       use of undeclared identifier 'NULL'
      141:14    None            error       use of undeclared identifier 'sprintf'
      143:17    None            error       use of undeclared identifier 'sprintf'
      144:14    None            error       use of undeclared identifier 'sprintf'
      146:11    None            error       use of undeclared identifier 'vsprintf'
      174:5     None            error       use of undeclared identifier 'std'
      174:28    None            error       expected expression
      174:31    None            error       no member named 'iterator' in the global namespace; did you mean 'operator'?

 ◌ logger.hh:
        4:11    None            error       'stdlib.h' file not found
      157:62    None            error       unknown type name 'va_list'
      188:6     None            error       unknown type name 'FILE'
      189:6     None            error       use of undeclared identifier 'std'
      190:6     None            error       use of undeclared identifier 'std'
      191:6     None            error       use of undeclared identifier 'std'
      191:19    None            error       use of undeclared identifier 'std'
      191:32    None            error       expected '(' for function-style cast or type construction
      191:46    None            error       expected member name or ';' after declaration specifiers
      171:8     None            error       use of undeclared identifier 'assertions'
      171:34    None            error       use of undeclared identifier 'std'
      175:156   None            error       use of undeclared identifier 'NULL'
      175:176   None            error       use of undeclared identifier 'NULL'
      175:188   None            error       use of undeclared identifier 'stderr'
      207:24    None            error       unknown type name 'FILE'
      217:6     None            error       use of undeclared identifier 'std'

 ◌ lslmini.cc:
        1:11    None            error       'stdio.h' file not found
       21:2     None            error       use of undeclared identifier 'std'
       26:10    None            error       cannot initialize return object of type 'int' with an lvalue of type 'const char [11]'
       41:9     None            error       unknown type name 'FILE'
       68:27    None            error       use of undeclared identifier 'NULL'
       69:27    None            error       use of undeclared identifier 'NULL'
       70:27    None            error       use of undeclared identifier 'NULL'
       71:38    None            error       use of undeclared identifier 'NULL'
       72:27    None            error       use of undeclared identifier 'NULL'
       73:29    None            error       use of undeclared identifier 'NULL'
       74:6     None            error       use of undeclared identifier 'NULL'
       74:27    None            error       use of undeclared identifier 'NULL'
       81:5     None            error       use of undeclared identifier 'NULL'
       96:8     None            error       use of undeclared identifier 'printf'
       98:5     None            error       use of undeclared identifier 'printf'
      112:21    None            error       use of undeclared identifier 'NULL'
      121:93    None            error       use of undeclared identifier 'NULL'
      121:150   None            error       use of undeclared identifier 'NULL'
      124:19    None            error       use of undeclared identifier 'NULL'
      125:31    None            error       use of undeclared identifier 'NULL'

 ◌ lslmini.hh:
        4:11    None            error       'stdlib.h' file not found
       27:11    None            error       'lslmini.tab.h' file not found

 ◌ operators.cc:
        7:25    None            error       use of undeclared identifier 'NULL'
       10:16    None            error       use of undeclared identifier 'INC_OP'
       11:16    None            error       use of undeclared identifier 'DEC_OP'
       15:32    None            error       use of undeclared identifier 'NULL'
       36:47    None            error       use of undeclared identifier 'SHIFT_LEFT'
       37:47    None            error       use of undeclared identifier 'SHIFT_RIGHT'
       38:47    None            error       use of undeclared identifier 'BOOLEAN_AND'
       39:47    None            error       use of undeclared identifier 'BOOLEAN_OR'
       40:47    None            error       use of undeclared identifier 'EQ'
       41:47    None            error       use of undeclared identifier 'NEQ'
       42:69    None            error       use of undeclared identifier 'NULL'
       56:45    None            error       use of undeclared identifier 'EQ'
       57:45    None            error       use of undeclared identifier 'NEQ'
       58:67    None            error       use of undeclared identifier 'NULL'
       63:41    None            error       use of undeclared identifier 'NULL'
       71:25    None            error       use of undeclared identifier 'NULL'
       74:16    None            error       use of undeclared identifier 'INC_OP'
       75:16    None            error       use of undeclared identifier 'DEC_OP'
       77:32    None            error       use of undeclared identifier 'NULL'

 ◌ position.hh:
       29:12    None            error       'iostream' file not found
       80:6     None            error       use of undeclared identifier 'std'
      121:11    None            error       use of undeclared identifier 'std'
      122:16    None            error       use of undeclared identifier 'std'

 ◌ stack.hh:
       24:11    None            error       'deque' file not found
       28:34    None            error       use of undeclared identifier 'std'
       88:34    None            error       too few template arguments for class template 'Stack'
       29:10    None            info        template is declared here

 ◌ symtab.cc:
        1:11    None            error       'string.h' file not found
       13:28    None            error       use of undeclared identifier 'NULL'
       17:10    None            error       use of undeclared identifier 'std'
       17:38    None            error       expected expression
       17:41    None            error       no member named 'iterator' in the global namespace; did you mean 'operator'?
       17:50    None            error       unknown type name 'i'
       18:10    None            error       use of undeclared identifier 'i'
       18:30    None            error       use of undeclared identifier 'i'
       19:13    None            error       use of undeclared identifier 'i'
       20:24    None            error       use of undeclared identifier 'i'
       27:5     None            error       use of undeclared identifier 'std'
       27:32    None            error       expected expression
       27:35    None            error       no member named 'const_iterator' in the global namespace
       28:57    None            error       use of undeclared identifier 'NULL'
       30:21    None            error       use of undeclared identifier 'strcmp'
        8:21    None            error       use of undeclared identifier '_stricmp'
       34:10    None            error       use of undeclared identifier 'sym'
       34:33    None            error       use of undeclared identifier 'sym'
       34:57    None            error       use of undeclared identifier 'sym'
       35:33    None            error       use of undeclared identifier 'sym'

 ◌ symtab.hh:
        4:11    None            error       'vector' file not found
       12:118   None            error       unknown type name 'YYLTYPE'
       46:6     None            error       unknown type name 'YYLTYPE'
       57:6     None            error       unknown type name 'YYLTYPE'
       12:176   None            error       use of undeclared identifier 'NULL'
       16:161   None            error       use of undeclared identifier 'NULL'
       14:23    None            error       use of undeclared identifier 'NULL'
       18:23    None            error       use of undeclared identifier 'NULL'
       19:25    None            error       unknown type name 'YYLTYPE'
       74:6     None            error       use of undeclared identifier 'std'

 ◌ types.cc:
       23:7     None            error       use of undeclared identifier 'INC_OP'
       24:7     None            error       use of undeclared identifier 'INC_OP'
       27:7     None            error       use of undeclared identifier 'DEC_OP'
       28:7     None            error       use of undeclared identifier 'DEC_OP'
      109:7     None            error       use of undeclared identifier 'EQ'
      110:7     None            error       use of undeclared identifier 'EQ'
      111:7     None            error       use of undeclared identifier 'EQ'
      112:7     None            error       use of undeclared identifier 'EQ'
      113:7     None            error       use of undeclared identifier 'EQ'
      114:7     None            error       use of undeclared identifier 'EQ'
      115:7     None            error       use of undeclared identifier 'EQ'
      116:7     None            error       use of undeclared identifier 'EQ'
      117:7     None            error       use of undeclared identifier 'EQ'
      118:7     None            error       use of undeclared identifier 'EQ'
      119:7     None            error       use of undeclared identifier 'EQ'
      122:7     None            error       use of undeclared identifier 'NEQ'
      123:7     None            error       use of undeclared identifier 'NEQ'
      124:7     None            error       use of undeclared identifier 'NEQ'
      125:7     None            error       use of undeclared identifier 'NEQ'

 ◌ types.hh:
       68:13    None            error       use of undeclared identifier 'std'
       26:8     None            error       use of undeclared identifier 'std'
       26:20    None            error       'LLScriptType' does not refer to a value
       22:8     None            info        declared here
       26:33    None            error       expected expression
       26:36    None            error       no member named 'iterator' in the global namespace; did you mean 'operator'?
       26:45    None            error       unknown type name 'i'
       28:14    None            error       use of undeclared identifier 'i'
       28:33    None            error       use of undeclared identifier 'i'
       28:53    None            error       use of undeclared identifier 'i'
       29:17    None            error       use of undeclared identifier 'i'
       29:51    None            error       use of undeclared identifier 'i'

 ◌ values.cc:
        5:18    None            error       use of undeclared identifier 'NULL'
       31:18    None            error       use of undeclared identifier 'NULL'
       32:28    None            error       use of undeclared identifier 'NULL'
       37:28    None            error       use of undeclared identifier 'NULL'
       37:148   None            error       use of undeclared identifier 'NULL'
       38:28    None            error       use of undeclared identifier 'NULL'
       45:29    None            error       use of undeclared identifier 'NULL'
       48:28    None            error       use of undeclared identifier 'NULL'
       54:86    None            error       use of undeclared identifier 'NULL'
       57:38    None            error       use of undeclared identifier 'NULL'
       57:55    None            error       use of undeclared identifier 'NULL'
       60:28    None            error       use of undeclared identifier 'NULL'
       79:96    None            error       use of undeclared identifier 'NULL'
       80:43    None            error       use of undeclared identifier 'stderr'
       80:71    None            error       use of undeclared identifier 'EXIT_FAILURE'
       93:25    None            error       use of undeclared identifier 'NULL'
      131:25    None            error       use of undeclared identifier 'NULL'
      171:20    None            error       use of undeclared identifier 'NULL'
      174:28    None            error       use of undeclared identifier 'NULL'
Sei-Lisa commented 6 years ago
   1:11    None            error       'stdio.h' file not found
  29:12    None            error       'iostream' file not found
   2:11    None            error       'stdlib.h' file not found
  24:11    None            error       'deque' file not found
   4:11    None            error       'vector' file not found
   1:11    None            error       'string.h' file not found
  27:11    None            error       'lslmini.tab.h' file not found

That looks like the include path is seriously broken, which causes all the other errors. Also, that last file is generated by flex or bison, can't remember which, so it seems that you don't have them either, or that the makefile failed to run them for some reason.

Makopo commented 6 years ago

Will you check if attached binary work well? lslint.exe.zip I don't know much about linkages but the recent builds are built with VS 2017 community and that might cause this issue. BTW the build included in my LSL plugin is xp version, which are built with old SDK7.1, not VS 2017.

Sei-Lisa commented 6 years ago

It doesn't seem to be about the binary/libs, but about the build process (or perhaps the makefile). Somehow it doesn't manage to find include files as basic as iostream or stdio.h. I'm not able to reproduce that build environment, so I have no way to debug it.

Makopo commented 6 years ago

@buildersbrewery can you reproduce the issue or work well if you build from source?

buildersbrewery commented 6 years ago

@Makopo I didn't run the build process as I didn't have too much time yesterday. I'll look into this further and report back.

Sei-Lisa commented 6 years ago

I'm confused. You can only get these errors while compiling lslint. If you were not doing that, I'd appreciate a more elaborate explanation on what you were trying to achieve and how.

buildersbrewery commented 6 years ago

I was looking into how to:


Anyhow, to get back to the topic here:


@Makopo From a usability standpoint all three Windows binaries from v1.0.9 work just fine on my machine.

Sei-Lisa commented 6 years ago

I wonder if you have a C++ library at all. Usually, compiler packages come with the libraries included, but from the clangd description page, it seems to me that it's just the compiler itself with no libraries.

Also, clangd must somehow find the includes, so I guess there must be some kind of configuration to tell it where the includes and libraries are installed, so even if you have installed them, there may still be a misconfiguration issue.

Sei-Lisa commented 6 years ago

There's also the issue of needing flex and bison. I wonder if lslint should include the generated lslmini.tab.h in the repository, for the benefit of those who don't have flex or bison installed and don't want to fiddle with lslmini.l or lslmini.y.

Sei-Lisa commented 6 years ago

@buildersbrewery How did this end up? Should we keep this issue open?

Sei-Lisa commented 6 years ago

@Makopo I suggest to close this for now. It doesn't seem like something needing any actions from the lslint side. If the OP wants to provide more information on what lslint can do to help with this, it can be reopened.

Makopo commented 6 years ago

Since no response from submitter for a while and it seems building environment issue, closing this.