Conversation
| void display_time_diff(time_t time1, time_t time2) | ||
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | ||
| print_string(buf); |
There was a problem hiding this comment.
[clang-format-pr] reported by reviewdog 🐶
| void display_time_diff(time_t time1, time_t time2) | |
| { | |
| char buf[BUF_SIZE]; | |
| time_t the_time = time2 - time1; | |
| char t = ctime(&the_time); | |
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | |
| print_string(buf); | |
| void display_time_diff(time_t time1, time_t time2) { | |
| char buf[BUF_SIZE]; | |
| time_t the_time = time2 - time1; | |
| char t = ctime(&the_time); | |
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | |
| print_string(buf); |
| void display_time_diff2(time_t time1, time_t time2) | ||
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | ||
| print_string(buf); |
There was a problem hiding this comment.
[clang-format-pr] reported by reviewdog 🐶
| void display_time_diff2(time_t time1, time_t time2) | |
| { | |
| char buf[BUF_SIZE]; | |
| time_t the_time = time2 - time1; | |
| char t = ctime(&the_time); | |
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | |
| print_string(buf); | |
| void display_time_diff2(time_t time1, time_t time2) { | |
| char buf[BUF_SIZE]; | |
| time_t the_time = time2 - time1; | |
| char t = ctime(&the_time); | |
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | |
| print_string(buf); |
| * Print the time diff from current time | ||
| */ | ||
| void display_time_diff(time_t old_time) | ||
| void display_time_diff_from_now(time_t old_time) |
Check failure
Code scanning / C/C++test
A declaration shall be visible when an object or function with external linkage is defined Error
| * Print the time diff from current time | ||
| */ | ||
| void display_time_diff(time_t old_time) | ||
| void display_time_diff_from_now(time_t old_time) |
Check failure
Code scanning / C/C++test
The types defined in the library <time.h> shall not be used Error
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff(time_t time1, time_t time2) |
Check failure
Code scanning / C/C++test
A declaration shall be visible when an object or function with external linkage is defined Error
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff(time_t time1, time_t time2) |
Check failure
Code scanning / C/C++test
The types defined in the library <time.h> shall not be used Error
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff(time_t time1, time_t time2) |
Check failure
Code scanning / C/C++test
The types defined in the library <time.h> shall not be used Error
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); |
Check warning
Code scanning / C/C++test
A conversion should not be performed between a pointer to object and an integer type Warning
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); |
Check failure
Code scanning / C/C++test
The time handling functions and macros of the library <time.h> shall not be used Error
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); |
Check failure
Code scanning / C/C++test
The input/output functions from the 'cstdio' and 'cwchar' libraries should not be used Error
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); |
Check failure
Code scanning / C/C++test
The value returned by a function having non-void return type shall be used Error
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | ||
| print_string(buf); |
Check failure
Code scanning / C/C++test
The value returned by a function having non-void return type shall be used Error
| void display_time_diff3(time_t time1, time_t time2) | ||
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | ||
| print_string(buf); |
There was a problem hiding this comment.
[clang-format-pr] reported by reviewdog 🐶
| void display_time_diff3(time_t time1, time_t time2) | |
| { | |
| char buf[BUF_SIZE]; | |
| time_t the_time = time2 - time1; | |
| char t = ctime(&the_time); | |
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | |
| print_string(buf); | |
| void display_time_diff3(time_t time1, time_t time2) { | |
| char buf[BUF_SIZE]; | |
| time_t the_time = time2 - time1; | |
| char t = ctime(&the_time); | |
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | |
| print_string(buf); |
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | ||
| print_string(buf); | ||
| } | ||
|
|
There was a problem hiding this comment.
[clang-format-pr] reported by reviewdog 🐶
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff3(time_t time1, time_t time2) |
Check failure
Code scanning / C/C++test
A declaration shall be visible when an object or function with external linkage is defined Error
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff3(time_t time1, time_t time2) |
Check failure
Code scanning / C/C++test
The types defined in the library <time.h> shall not be used Error
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff3(time_t time1, time_t time2) |
Check failure
Code scanning / C/C++test
The types defined in the library <time.h> shall not be used Error
| void display_time_diff3(time_t time1, time_t time2) | ||
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; |
Check failure
Code scanning / C/C++test
The types defined in the library <time.h> shall not be used Error
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); |
Check warning
Code scanning / C/C++test
A conversion should not be performed between a pointer to object and an integer type Warning
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); |
Check failure
Code scanning / C/C++test
The time handling functions and macros of the library <time.h> shall not be used Error
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); |
Check failure
Code scanning / C/C++test
The input/output functions from the 'cstdio' and 'cwchar' libraries should not be used Error
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); |
Check failure
Code scanning / C/C++test
The value returned by a function having non-void return type shall be used Error
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | ||
| print_string(buf); |
Check failure
Code scanning / C/C++test
The value returned by a function having non-void return type shall be used Error
| * Print the time diff from current time | ||
| */ | ||
| void display_time_diff(time_t old_time) | ||
| void display_time_diff_from_now(time_t old_time) |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_8_4-a> reported by reviewdog 🐶
Prototype of function 'display_time_diff_from_now' does not precede function definition
| * Print the time diff from current time | ||
| */ | ||
| void display_time_diff(time_t old_time) | ||
| void display_time_diff_from_now(time_t old_time) |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_21_10-c> reported by reviewdog 🐶
The 'time_t' identifier should not be used
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff(time_t time1, time_t time2) |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_8_4-a> reported by reviewdog 🐶
Prototype of function 'display_time_diff' does not precede function definition
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff(time_t time1, time_t time2) |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_21_10-c> reported by reviewdog 🐶
The 'time_t' identifier should not be used
| /* | ||
| * Print the time difference | ||
| */ | ||
| void display_time_diff(time_t time1, time_t time2) |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_21_10-c> reported by reviewdog 🐶
The 'time_t' identifier should not be used
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); |
There was a problem hiding this comment.
Pointer to object type 'char *' should not be converted to integral type 'char'
| { | ||
| char buf[BUF_SIZE]; | ||
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_21_10-b> reported by reviewdog 🐶
Usage of 'ctime' function is not allowed
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_21_6-a> reported by reviewdog 🐶
The 'sprintf' library function should not be used
| time_t the_time = time2 - time1; | ||
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_17_7-a> reported by reviewdog 🐶
Unused function's "sprintf" return value
| char t = ctime(&the_time); | ||
|
|
||
| sprintf(buf, "\n\nTime difference is %s\n\n", t); | ||
| print_string(buf); |
There was a problem hiding this comment.
🚫 [C/C++test] <MISRAC2012-RULE_17_7-a> reported by reviewdog 🐶
Unused function's "print_string" return value
No description provided.