options: add workaround for spurious warning with gcc 11–13
gcc 14+ doesn't need this.
This commit is contained in:
@@ -95,7 +95,7 @@ int option_parse(
|
||||
|
||||
/* Look for the next option */
|
||||
|
||||
const Option *option;
|
||||
const Option *option = NULL; /* initialization to appease gcc 13 */
|
||||
const char *optname = NULL, *optval = NULL;
|
||||
_cleanup_free_ char *_optname = NULL; /* allocated option name */
|
||||
bool separate_optval = false;
|
||||
@@ -206,6 +206,8 @@ int option_parse(
|
||||
}
|
||||
}
|
||||
|
||||
assert(option);
|
||||
|
||||
if (optval && !option_takes_arg(option))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s: option '%s' doesn't allow an argument",
|
||||
|
||||
Reference in New Issue
Block a user