Bug #505

ctools static code analysis errors and warnings

Added by Knödlseder Jürgen over 11 years ago. Updated about 10 years ago.

Status:ClosedStart date:09/19/2012
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:-
Duration:

Description

Running Eclipse C++ code analysis on ctools gives the four errors and three warnings shown below.

The errors are again Eclipse CODAN bugs:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=355767#c4

I think the warnings are irrelevant in our case.
Nevertheless, why not fix them, i.e. always catch by reference?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360101

Overall the Eclipse static code analysis is not very powerful, but it’s still useful to catch all those little typos and argument list order and missing includes and ... while coding without having to run a build.

Description    Resource    Path    Location    Type
'toupper' is ambiguous '
Candidates are:
std::basic_string<char,std::char_traits<char>,std::allocator<char>> toupper(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &)
'    ctlike.cpp    /ctools/src/ctlike    line 354    Semantic Error
Catching by reference is recommended 'GException::fits_open_error'    ctlike.cpp    /ctools/src/ctlike    line 370    Code Analysis Problem
'toupper' is ambiguous '
Candidates are:
std::basic_string<char,std::char_traits<char>,std::allocator<char>> toupper(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &)
'    ctlike.cpp    /ctools/src/ctlike    line 297    Semantic Error
'toupper' is ambiguous '
Candidates are:
std::basic_string<char,std::char_traits<char>,std::allocator<char>> toupper(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &)
'    ctskymap.cpp    /ctools/src/ctskymap    line 428    Semantic Error
Catching by reference is recommended 'GException::fits_open_error'    ctselect.cpp    /ctools/src/ctselect    line 417    Code Analysis Problem
'toupper' is ambiguous '
Candidates are:
std::basic_string<char,std::char_traits<char>,std::allocator<char>> toupper(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &)
'    ctbin.cpp    /ctools/src/ctbin    line 510    Semantic Error
Catching by reference is recommended 'GException::fits_open_error'    ctbin.cpp    /ctools/src/ctbin    line 412    Code Analysis Problem

Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 11 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Indeed, I do not understand the toupper warnings.

I agree that catching by reference is the right thing to do. Thanks for catching these “bugs”. I corrected them.

#2 Updated by Knödlseder Jürgen about 10 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF