-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
MDEV-36542 Remove compile options for faking initialization #3961
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
26671bf
26d2ba2
a19502c
871c44e
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 |
---|---|---|
|
@@ -1728,9 +1728,16 @@ bool Item_func_json_contains_path::val_bool() | |
longlong result; | ||
json_path_t p; | ||
int n_found; | ||
LINT_INIT(n_found); | ||
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. Please add back or replace with UNINIT_VAR() 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, but left a comment noting the last observed compiler warning version so one day it can be removed with less back checking. 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 has still to be fixed |
||
int array_sizes[JSON_DEPTH_LIMIT]; | ||
uint has_negative_path= 0; | ||
#if defined(FORCE_INIT_OF_VARS) | ||
/* | ||
Initialization force not required after gcc 13.3 | ||
where it correctly sees that an uninitialized read | ||
of n_found doesn't occur with mode_one being true. | ||
*/ | ||
n_found= 0; | ||
#endif | ||
grooverdan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if ((null_value= args[0]->null_value)) | ||
return 0; | ||
|
@@ -1770,8 +1777,6 @@ bool Item_func_json_contains_path::val_bool() | |
bzero(p_found, (arg_count-2) * sizeof(bool)); | ||
n_found= arg_count - 2; | ||
} | ||
else | ||
n_found= 0; /* Just to prevent 'uninitialized value' warnings */ | ||
|
||
result= 0; | ||
while (json_get_path_next(&je, &p) == 0) | ||
|
@@ -2644,7 +2649,6 @@ String *Item_func_json_merge::val_str(String *str) | |
String *js1= args[0]->val_json(&tmp_js1), *js2=NULL; | ||
uint n_arg; | ||
THD *thd= current_thd; | ||
LINT_INIT(js2); | ||
montywi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
JSON_DO_PAUSE_EXECUTION(thd, 0.0002); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1179,7 +1179,7 @@ bool FILTER::Convert(PGLOBAL g, bool having) | |
case OP_GT: | ||
case OP_GE: | ||
case OP_LT: | ||
case OP_LE: new(this) FILTERCMP(g); break; | ||
case OP_LE: new(this) FILTERCMP(g, Opc); break; | ||
case OP_AND: new(this) FILTERAND; break; | ||
case OP_OR: new(this) FILTEROR; break; | ||
case OP_NOT: new(this) FILTERNOT; break; | ||
|
@@ -1589,8 +1589,9 @@ void FILTER::Prints(PGLOBAL g, char *ps, uint z) | |
/***********************************************************************/ | ||
/* FILTERCMP constructor. */ | ||
/***********************************************************************/ | ||
FILTERCMP::FILTERCMP(PGLOBAL g) | ||
FILTERCMP::FILTERCMP(PGLOBAL g, OPVAL Opc) | ||
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. Opc -> Opc_arg |
||
{ | ||
this->Opc= Opc; | ||
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. Change to Opc= Opc_arg |
||
Bt = OpBmp(g, Opc); | ||
} // end of FILTERCMP constructor | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1611,7 +1611,9 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) | |
if (Tdbp->Xpand) | ||
n = Tdbp->Limit; | ||
|
||
auto oLong = Long; | ||
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. Please do not use auto. I suggest this patch instead that makes this a bit more clear: +++ b/storage/connect/tabxml.cpp
Valbuf = (char*)PlugSubAlloc(g, NULL, n * (Long + 1));
|
||
new(this) XMULCOL(Value); // Change the class of this column | ||
Long = oLong; | ||
} // endif Inod | ||
|
||
Valbuf = (char*)PlugSubAlloc(g, NULL, n * (Long + 1)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,9 +236,6 @@ int main(int argc, char **argv) | |
} | ||
maria_end(); | ||
my_exit(error); | ||
#ifndef _lint | ||
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. Keep the return 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. After a no-return |
||
return 0; /* No compiler warning */ | ||
#endif | ||
} /* main */ | ||
|
||
enum options_mc { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,11 +289,9 @@ int main(int argc, char **argv) | |
maria_end(); | ||
my_end(verbose ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR); | ||
exit(error ? 2 : 0); | ||
#ifndef _lint | ||
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. Keep the return 0; |
||
return 0; /* No compiler warning */ | ||
#endif | ||
} | ||
|
||
ATTRIBUTE_NORETURN | ||
static void my_exit(int error) | ||
{ | ||
free_defaults(default_argv); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,9 +124,6 @@ int main(int argc, char **argv) | |
my_end(check_param.testflag & T_INFO ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR); | ||
rc= (uchar) error; | ||
exit(rc); | ||
#ifndef _lint | ||
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. Keep the return 0; |
||
return 0; /* No compiler warning */ | ||
#endif | ||
} /* main */ | ||
|
||
enum options_mc { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,9 +248,6 @@ int main(int argc, char **argv) | |
free_defaults(default_argv); | ||
my_end(verbose ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR); | ||
exit(error ? 2 : 0); | ||
#ifndef _lint | ||
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. Keep the return 0; |
||
return 0; /* No compiler warning */ | ||
#endif | ||
} | ||
|
||
enum options_mp {OPT_CHARSETS_DIR_MP=256}; | ||
|
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.
Please remove SET(CMAKE_${LANG}FLAGS "${CMAKE${LANG}_FLAGS} -Werror=uninitialized")
We already set -Werror, in maintainer mode. We don't need -Werror=unintialized
We should not break the compilation in non maintainer mode just for an uninitialized error like we do not break it for other warnings. We will catch the issue in buildbot if needed.
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 checked with Serg and he agrees we should not break on errors outside maintainer mode.
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.
ok to push after the above is fixed