JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.2p0 | CONFIDENTIAL | CodeSecure Inc |
A use of one of the functions defined in <time.h>: asctime(), asctime_r(), clock(), clock_getres(), clock_gettime(), clock_settime(), ctime(), ctime_r(), difftime(), getdate(), gmtime(), gmtime_r(), localtime(), localtime_r(), mktime(), nanosleep(), strftime(), strptime(), time(), timer_create(), timer_delete(), timer_gettime(), timer_getoverrun(), timer_settime(), tzset().
These functions are associated with unspecified, undefined, and implementation-defined behaviors.
| Class Name | Use of <time.h> Time/Date Function | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Significance | style | ||||||||||||||||||||||||||||||||||||
| Mnemonic | BADFUNC.TIME_H | ||||||||||||||||||||||||||||||||||||
| Categories |
|
||||||||||||||||||||||||||||||||||||
| Availability | Available for C and C++. |
||||||||||||||||||||||||||||||||||||
| Enabling | Checks for this warning class are
disabled by default. To enable them, add the following WARNING_FILTER
rule to the project configuration file.
WARNING_FILTER += allow class="Use of <time.h> Time/Date Function" |
#include <time.h>
void long_running_func(void);
clock_t instrument_my_code(void){
clock_t t;
t = clock(); /* 'Use of <time.h> Time/Date Function' warning issued here */
long_running_func();
return clock() - t; /* 'Use of <time.h> Time/Date Function' warning issued here */
}
This class is implemented using a BAD_FUNCTION_* rule set in the general template configuration file.
The following configuration file parameters affect checks for this warning class.
To report problems with this documentation, please visit https://support.codesecure.com/.