-
Notifications
You must be signed in to change notification settings - Fork 126
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
[CBRD-25212] remove warning messages from compilation #4933
base: develop
Are you sure you want to change the base?
Changes from all commits
b65eb96
2745f21
6cacf3c
7e391be
2bdf722
05982bf
06fadd9
72f8668
d45c647
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 |
---|---|---|
|
@@ -622,7 +622,7 @@ logddl_make_copy_filename (T_APP_NAME app_name, const char *file_full_path, char | |
const char *name_tmp = NULL; | ||
int retval = 0; | ||
|
||
if (file_full_path == NULL || copy_filename == NULL || buf_size < 0) | ||
if (file_full_path == NULL || copy_filename == NULL) | ||
{ | ||
return -1; | ||
} | ||
|
@@ -658,7 +658,7 @@ logddl_make_copy_dir (T_APP_NAME app_name, char *copy_filename, char *copy_fullp | |
const char *env_root = NULL; | ||
int retval = 0; | ||
|
||
if (copy_filename == NULL || copy_fullpath == NULL || buf_size < 0) | ||
if (copy_filename == NULL || copy_fullpath == NULL) | ||
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. I think it would be better to remove the buf_size argument and specify PATH_MAX directly. 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. I think the buf_size parameter should be kept. The reason is that the size of the string can change. |
||
{ | ||
return -1; | ||
} | ||
|
@@ -883,7 +883,7 @@ logddl_write_tran_str (const char *fmt, ...) | |
len = DDL_LOG_BUFFER_SIZE; | ||
} | ||
|
||
if (len < 0 || fwrite (msg, sizeof (char), len, fp) != len) | ||
if (len < 0 || fwrite (msg, sizeof (char), len, fp) != (size_t) len) | ||
{ | ||
goto write_error; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -488,7 +488,7 @@ static INI_LINE_STATUS | |
ini_parse_line (char *input_line, char *section, char *key, char *value) | ||
{ | ||
INI_LINE_STATUS status; | ||
char line[INI_BUFSIZ + 1]; | ||
char line[INI_BUFSIZ + 4]; | ||
int len; | ||
|
||
strcpy (line, ini_str_trim (input_line)); | ||
|
@@ -515,7 +515,7 @@ ini_parse_line (char *input_line, char *section, char *key, char *value) | |
leading_char = section[0]; | ||
if (leading_char == '@' || leading_char == '%') | ||
{ | ||
sprintf (section, "%c%s", leading_char, ini_str_trim (section + 1)); | ||
snprintf (section, INI_BUFSIZ + 2, "%c%s", leading_char, ini_str_trim (section + 1)); | ||
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 size of the section is (INI_BUFSIZ + 1). |
||
} | ||
|
||
if (leading_char != '@') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2684,6 +2684,8 @@ or_get_oid (OR_BUF * buf, OID * oid) | |
{ | ||
ASSERT_ALIGN (buf->ptr, INT_ALIGNMENT); | ||
|
||
OID_SET_NULL (oid); | ||
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. This should be moved to the then part of the if statement below because setting the oid fields is done in else part. 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. Ok, I aggree. |
||
|
||
if ((buf->ptr + OR_OID_SIZE) > buf->endptr) | ||
{ | ||
return or_underflow (buf); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,7 +255,7 @@ get_class_mops_from_file (const char *input_filename, MOP ** class_list, int *nu | |
goto end; | ||
} | ||
|
||
strncpy (class_names[i], buffer, len); | ||
strncpy (class_names[i], buffer, len + 1); | ||
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. Is there a reason to copy with a size of "len+1"? memcpy (class_names[i], buffer, len); 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. +1 is necessary because class_names[i] must end with a terminating zero. Isn't it? 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. @hyunikn |
||
class_names[i][len] = 0; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,7 +162,7 @@ char csql_Scratch_text[SCRATCH_TEXT_LEN]; | |
int csql_Error_code = NO_ERROR; | ||
|
||
static char csql_Prompt[100]; | ||
static char csql_Prompt_offline[100]; | ||
static char csql_Prompt_offline[101]; | ||
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. I think "snprintf (csql_Prompt_offline, sizeof (csql_Prompt_offline) - 1, "!%s", csql_Prompt);" is better than "csql_Prompt_offline[101]". (line 2772) |
||
static char csql_Name[100]; | ||
|
||
/* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -493,7 +493,7 @@ namespace cubmethod | |
fprintf (stdout, "tuple_count: %d\n", tuple_count); | ||
fprintf (stdout, "ins_oid (%d, %d, %d)\n", ins_oid.pageid, ins_oid.slotid, ins_oid.volid); | ||
fprintf (stdout, "include_oid: %d\n", include_oid); | ||
fprintf (stdout, "query_id: %lld\n", query_id); | ||
fprintf (stdout, "query_id: %ud\n", (unsigned int)query_id); | ||
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. query_id is of type UINTPTR. fprintf (stdout, "query_id: %ud\n", query_id); 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. It must be %u rather than %ud.
|
||
} | ||
|
||
void | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11518,7 +11518,7 @@ tp_value_auto_cast_with_precision_check (const DB_VALUE * src, DB_VALUE * dest, | |
/* if the numeric's precision is 19 or more, then it can get the bigint enough */ | ||
if (desired_domain->type->id == DB_TYPE_NUMERIC && desired_domain->precision < 19) | ||
{ | ||
INT64 bigint; | ||
INT64 bigint = 0; | ||
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. This should be moved to the default branch of the switch statement below because this is overwritten in other branches. |
||
|
||
assert (desired_domain->precision >= 0); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3568,7 +3568,7 @@ static int | |
mr_data_readval_utime (OR_BUF * buf, DB_VALUE * value, TP_DOMAIN * domain, int size, bool copy, char *copy_buf, | ||
int copy_buf_len) | ||
{ | ||
DB_UTIME utm; | ||
DB_UTIME utm = 0; | ||
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. This definition should be moved to the else branch of the if statement below because utm is used only in that branch. |
||
int rc = NO_ERROR; | ||
|
||
if (value == NULL) | ||
|
@@ -3591,7 +3591,7 @@ static int | |
mr_data_readval_timestampltz (OR_BUF * buf, DB_VALUE * value, TP_DOMAIN * domain, int size, bool copy, char *copy_buf, | ||
int copy_buf_len) | ||
{ | ||
DB_UTIME utm; | ||
DB_UTIME utm = 0; | ||
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. This definition should be moved to the else branch of the if statement below because utm is used only in that branch. |
||
int rc = NO_ERROR; | ||
|
||
if (value == NULL) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11607,7 +11607,7 @@ pt_convert_dblink_dml_query (PARSER_CONTEXT * parser, PT_NODE * node, | |
PT_NODE *list = NULL; /* for insert select list */ | ||
PT_NODE *spec, *into_spec = NULL, *upd_spec = NULL, *server; | ||
|
||
PARSER_VARCHAR *comment, *dml; | ||
PARSER_VARCHAR *comment = NULL, *dml; | ||
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. This NULL assignment should be moved to the default branch of the switch statement at line 11726 because in other branches the assignment is overwritten. |
||
|
||
switch (node->node_type) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to remove the buf_size argument and specify PATH_MAX directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the buf_size parameter should be kept. The reason is that the size of the string can change.