Fails to build with Clang due to -Werror=c23-extensions
jbeich opened this issue · comments
Jan Beich commented
Regressed by 7da0314. Missing semicolon after case
label?
Clang 18 fails with:
src/conf/decode.c:165:13: error: label followed by a declaration is a C23 extension [-Werror,-Wc23-extensions]
165 | char **str_ptr_ptr = BS_VALUE_AT(
| ^
src/conf/decode.c:265:13: error: label followed by a declaration is a C23 extension [-Werror,-Wc23-extensions]
265 | char **str_ptr = BS_VALUE_AT(
| ^
Clang 17 and earlier fail with:
src/conf/decode.c:165:13: error: expected expression
165 | char **str_ptr_ptr = BS_VALUE_AT(
| ^
src/conf/decode.c:167:26: error: use of undeclared identifier 'str_ptr_ptr'
167 | if (NULL != *str_ptr_ptr) {
| ^
src/conf/decode.c:168:23: error: use of undeclared identifier 'str_ptr_ptr'
168 | free(*str_ptr_ptr);
| ^
src/conf/decode.c:169:18: error: use of undeclared identifier 'str_ptr_ptr'
169 | *str_ptr_ptr = NULL;
| ^
src/conf/decode.c:265:13: error: expected expression
265 | char **str_ptr = BS_VALUE_AT(
| ^
src/conf/decode.c:267:26: error: use of undeclared identifier 'str_ptr'
267 | if (NULL != *str_ptr) free(*str_ptr);
| ^
src/conf/decode.c:267:41: error: use of undeclared identifier 'str_ptr'
267 | if (NULL != *str_ptr) free(*str_ptr);
| ^
src/conf/decode.c:268:14: error: use of undeclared identifier 'str_ptr'
268 | *str_ptr = logged_strdup(
| ^
src/conf/decode.c:270:26: error: use of undeclared identifier 'str_ptr'
270 | if (NULL == *str_ptr) return false;
| ^
Philipp Kaeser commented
:embarassed: ... not the first time. Need to get clang into the github workflows.
Philipp Kaeser commented
@jbeich -- thanks again for reporting! Hope the inclusion of clang as 2nd compiler will reduce these issues, going forward...