Skip to content

Feature2#2

Open
kber-ps wants to merge 10 commits into
mainfrom
feature2
Open

Feature2#2
kber-ps wants to merge 10 commits into
mainfrom
feature2

Conversation

@kber-ps
Copy link
Copy Markdown
Owner

@kber-ps kber-ps commented Apr 28, 2025

No description provided.

Comment thread clock.c
Comment on lines +39 to +46
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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[clang-format-pr] reported by reviewdog 🐶

Suggested change
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);

Comment thread clock.c
Comment on lines +52 to +59
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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[clang-format-pr] reported by reviewdog 🐶

Suggested change
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);

Comment thread clock.c
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[clang-format-pr] reported by reviewdog 🐶

ghdemo/clock.c

Lines 26 to 33 in 2a6c4e5

void display_time_diff_from_now(time_t old_time)
{
char buf[BUF_SIZE];
time_t the_time = old_time - time(NULL);
char t = ctime(&the_time);
sprintf(buf, "\n\nCurrent Time and Date is %s\n\n", t);
print_string(buf);

Comment thread clock.c
* 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

Prototype of function 'display_time_diff_from_now' does not precede function definition
Comment thread clock.c
* 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

The 'time_t' identifier should not be used
Comment thread clock.c
/*
* 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

Prototype of function 'display_time_diff' does not precede function definition
Comment thread clock.c
/*
* 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

The 'time_t' identifier should not be used
Comment thread clock.c
/*
* 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

The 'time_t' identifier should not be used
Comment thread clock.c
{
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

Pointer to object type 'char *' should not be converted to integral type 'char'
Comment thread clock.c
{
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

Usage of 'ctime' function is not allowed
Comment thread clock.c
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

The 'sprintf' library function should not be used
Comment thread clock.c
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

Unused function's "sprintf" return value
Comment thread clock.c
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

Unused function's "print_string" return value
Comment thread clock.c
Comment on lines +65 to +72
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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[clang-format-pr] reported by reviewdog 🐶

Suggested change
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);

Comment thread clock.c
sprintf(buf, "\n\nTime difference is %s\n\n", t);
print_string(buf);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[clang-format-pr] reported by reviewdog 🐶

Suggested change

Comment thread clock.c
/*
* 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

Prototype of function 'display_time_diff3' does not precede function definition
Comment thread clock.c
/*
* 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

The 'time_t' identifier should not be used
Comment thread clock.c
/*
* 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

The 'time_t' identifier should not be used
Comment thread clock.c
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

The 'time_t' identifier should not be used
Comment thread clock.c
{
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

Pointer to object type 'char *' should not be converted to integral type 'char'
Comment thread clock.c
{
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

Usage of 'ctime' function is not allowed
Comment thread clock.c
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

The 'sprintf' library function should not be used
Comment thread clock.c
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

Unused function's "sprintf" return value
Comment thread clock.c
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

Unused function's "print_string" return value
Comment thread clock.c
* 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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_8_4-a> reported by reviewdog 🐶
Prototype of function 'display_time_diff_from_now' does not precede function definition

Comment thread clock.c
* 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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_21_10-c> reported by reviewdog 🐶
The 'time_t' identifier should not be used

Comment thread clock.c
/*
* Print the time difference
*/
void display_time_diff(time_t time1, time_t time2)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_8_4-a> reported by reviewdog 🐶
Prototype of function 'display_time_diff' does not precede function definition

Comment thread clock.c
/*
* Print the time difference
*/
void display_time_diff(time_t time1, time_t time2)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_21_10-c> reported by reviewdog 🐶
The 'time_t' identifier should not be used

Comment thread clock.c
/*
* Print the time difference
*/
void display_time_diff(time_t time1, time_t time2)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_21_10-c> reported by reviewdog 🐶
The 'time_t' identifier should not be used

Comment thread clock.c
{
char buf[BUF_SIZE];
time_t the_time = time2 - time1;
char t = ctime(&the_time);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [C/C++test] <MISRAC2012-RULE_11_4-a> reported by reviewdog 🐶
Pointer to object type 'char *' should not be converted to integral type 'char'

Comment thread clock.c
{
char buf[BUF_SIZE];
time_t the_time = time2 - time1;
char t = ctime(&the_time);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_21_10-b> reported by reviewdog 🐶
Usage of 'ctime' function is not allowed

Comment thread clock.c
time_t the_time = time2 - time1;
char t = ctime(&the_time);

sprintf(buf, "\n\nTime difference is %s\n\n", t);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_21_6-a> reported by reviewdog 🐶
The 'sprintf' library function should not be used

Comment thread clock.c
time_t the_time = time2 - time1;
char t = ctime(&the_time);

sprintf(buf, "\n\nTime difference is %s\n\n", t);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_17_7-a> reported by reviewdog 🐶
Unused function's "sprintf" return value

Comment thread clock.c
char t = ctime(&the_time);

sprintf(buf, "\n\nTime difference is %s\n\n", t);
print_string(buf);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [C/C++test] <MISRAC2012-RULE_17_7-a> reported by reviewdog 🐶
Unused function's "print_string" return value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants