klocwork

Not null terminated string - a KlocWork error with no understandable reason.

I've recently installed "klocwork" and am trying to get rid of bugs on an existing code. The error shown seems to be simple. No null at the termination of the char * _p_. I have manually added a null termination (even though there is no need), but it doesn't please the Klocwork. Any ideas? The exact message is:- Incorrectly termin...

Not null terminated string false alarm?

Klocwork is producing an alarm which seems to be a false one. The bug it mentions describes about 80% of the total bugs in our code. Please advise, Hereby is a snip set (paraphrase):- //a snip set // no bug here // { char* destStr; destStr = (char*)malloc(150); if (destStr != NULL) { destStr[0]= '\0'; //__here is the ...

ABR - Klocwork false alarms and incorrect bug disposal

Hi, Klocwork reports an error of:- "ABR – Buffer overflow, array index of 'oidsp' may be out of bounds. Array 'oidsp' of size 64 may use index value(s) -2..-1." For this line:- if (check_index_lower_legality (len,-1)) { oidsp[len-1] = specProb; } When check_index_lower_legality is:- bool check_index_lower_legality (in...

Project config issues how to specify a unique - kwcc_config.xml for each project?

The file kwcc_config.xml contains definitions and include paths for specific compilers used by our projects. Due to our different environments for different projects we need different definitions and paths for the projects. Is there an option to define such file per project? If so, how do I assign kwcc_config.xml file for each project?...

Does Klocwork detect never called functions?

Hi , my code is a mix up of different bits and pieces from older code. I would like to erase all never used functions in order to keep the code simple. Is Klocwork the tool? How do I do it? Thanks, Moshe. ...

Klocwork & c - The number of lines of source code actually used.

Hi, My project is made out of lots of bits and pieces of older code. How do I know how many lines of code were actually used? Can Klocwork provide me this answer? I've noticed that Klocwork holds the number of line (SLOC) in the project - but is it the number of actual lines used - or can it include "dead code" areas? Thanks, Mos...