eranif / codelite

A multi purpose IDE specialized in C/C++/Rust/Python/PHP and Node.js. Written in C++
https://codelite.org
GNU General Public License v2.0
2.15k stars 460 forks source link

Several compilation warnings reported by Clang #936

Closed ghost closed 9 years ago

ghost commented 9 years ago
codelite/sdk/wxshapeframework/src/GridShape.cpp:171:13: warning: 
      comparison of unsigned expression >= 0 is always true
      [-Wtautological-compare]
        if( (index >= 0) && (index < GetChildrenList().GetCount()) )
             ~~~~~ ^  ~

(I suspect the above one is a wxWidgets bug?)

codelite/CodeLite/scope_parser.cpp:900:13: warning: ISO C++11 does
      not allow conversion from string literal to 'char *' [-Wwritable-strings]
    yyerror("syntax error");

^ and several more of this kind.

codelite/MemCheck/memcheckoutputview.cpp:190:49: warning: 
      comparison of unsigned expression < 0 is always false
      [-Wtautological-compare]
    m_currentPageIsEmptyView = (iStop - iStart) < 0;
                               ~~~~~~~~~~~~~~~~ ^ ~

Finally:

codelite/CodeFormatter/formatoptions.h:185:83: warning: control
      reaches end of non-void function [-Wreturn-type]
  ...SetPHPFormatterOptions(size_t options) { m_phpFormatOptions = options; }

There are even more warnings reported by Clang but I'm not sure if it's worth to care about them; I've selected only those that I've found outstanding.

eranif commented 9 years ago

(I suspect the above one is a wxWidgets bug?)

It comes from a 3rd party library used by the DbExplorer plugin, anyways, fixed now

^ and several more of this kind.

These can't be fixed reliably as they are coming from an auto-generated code (yacc code) We can fix it now, next time we generate the code, these error will re-surface

Finally: codelite/CodeFormatter/formatoptions.h:185:83: warning: control reaches end of non-void function [-Wreturn-type] ...SetPHPFormatterOptions(size_t options) { m_phpFormatOptions = options; }

Fixed