-
Notifications
You must be signed in to change notification settings - Fork 23
CA-406953: fix more undefined behaviour #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b276416
9f5f8ec
2dadb75
5bcf80f
79ed87b
809c70e
26a80ad
dd04167
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,5 @@ include/mtcerrno.h | |
| scripts/generr | ||
| scripts/generr.o | ||
| scripts/ha_errnorc | ||
| compile_commands.json | ||
| .cache/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ | |
| #include <signal.h> | ||
| #include <unistd.h> | ||
| #include <stdlib.h> | ||
| #include <inttypes.h> | ||
|
|
||
|
|
||
|
|
||
|
|
@@ -322,7 +323,8 @@ MTC_STATIC void | |
| print_liveset( | ||
| MTC_S32 pri, | ||
| PMTC_S8 log_string, | ||
| MTC_HOSTMAP hostmap); | ||
| MTC_HOSTMAP hostmap) | ||
| __attribute__((format(printf, 2, 0))); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure? I cannot see the parameters, how can be a formatting string? Maybe it's a bug?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, never mind, the 0 says there are no parameter to check against. Maybe a kind of trick can be in place like static inline const char *
check_print_liveset_format(const char *fmt, ...) __attribute__((format(printf, 1, 2))
{
return fmt;
}
#define print_liveset(pri, fmt, map) print_liveset(pri, check_print_liveset_format(fmt, "dummy"), map)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The compiler is still not entirely happy about it, because it says that the 'log_string' is not a string literal, whereas in the other function where I used I'll try the macro trick, that should fix it. |
||
|
|
||
| MTC_STATIC void | ||
| wait_until_HBSF_state_stable(); | ||
|
|
@@ -2289,7 +2291,7 @@ wait_until_HBSF_state_stable() | |
| { | ||
| log_maskable_debug_message(FH_TRACE, | ||
| "FH: waiting for HB from host (%d)," | ||
| " time since last HB receive = %d.\n", | ||
| " time since last HB receive = %"PRId64".\n", | ||
| index, now - phb->time_last_HB[index]); | ||
| logged_hb[index] = TRUE; | ||
| } | ||
|
|
@@ -2304,7 +2306,7 @@ wait_until_HBSF_state_stable() | |
| { | ||
| log_maskable_debug_message(FH_TRACE, | ||
| "FH: waiting for SF from host (%d)," | ||
| " time since last SF update = %d.\n", | ||
| " time since last SF update = %"PRId64".\n", | ||
| index, | ||
| now - psf->time_last_SF[index]); | ||
| logged_sf[index] = TRUE; | ||
|
|
@@ -2543,7 +2545,7 @@ wait_until_all_hosts_have_consistent_view( | |
| MTC_HOSTMAP_SET(removedhost, selected); | ||
| } | ||
|
|
||
| log_message(MTC_LOG_WARNING, "after merger:\n", index); | ||
| log_message(MTC_LOG_WARNING, "after merger: %d\n", index); | ||
| for (index = 0; _is_configured_host(index); index++) | ||
| { | ||
| MTC_HOSTMAP_INTERSECTION(phb->raw[index].hbdomain, '=', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.