Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DCLGPS::update(double dt) {
- ....
- string s;
- if(fgGetBool("/instrumentation/nav[0]/slaved-to-gps")) {
- // TODO - avoid the hardwiring on nav[0]
- s = "Adj Nav Crs to ";
- } else {
- string s = "GPS Course is ";
- }
- ....
- }
- This suspicious code was found in FlightGear project by PVS-Studio static code analyzer.
- Warning message is:
- V561 It's probably better to assign value to 's' variable than to declare it anew. Previous declaration: dclgps.cxx, line 480. dclgps.cxx 485
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment