7098f838f2
When applying HOSTCFLAGS to the libsubcmd build to resolve a separate issue, which contain '-std=gnu89' prior to commit 1e24078113ae ("Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS"), the following warning/error occurs: parse-options.c:643:8: error: GCC does not allow variable declarations in for loop initializers before C99 [-Werror,-Wgcc-compat] for (int i = 0; subcommands[i]; i++) { ^ parse-options.c:669:9: error: GCC does not allow variable declarations in for loop initializers before C99 [-Werror,-Wgcc-compat] for (int i = 0; subcommands[i]; i++) ^ This issue was never visible upstream, as commit 1e24078113ae ("Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS") was applied before commit 13e07691a16f ("tools/resolve_btfids: Alter how HOSTCC is forced"). Prior to the latter change, there was no '-std=' flag passed to the libsubcmd build, so the default standard value was used, which may be newer than C99. To resolve this issue to unblock applying HOSTCFLAGS to libsubcmd, just hoist the declarations out of the for loops. Bug: 301145081 Link: https://github.com/ClangBuiltLinux/linux/issues/1929 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Change-Id: I41f17964f3d0822b026f6ae8f06a4d49bc7f15a9 (cherry picked from https://android-review.googlesource.com/q/commit:8f75dab19c30be65c740bd4abf9587714b3305dc) |
||
---|---|---|
.. | ||
api | ||
bpf | ||
lockdep | ||
perf | ||
subcmd | ||
symbol | ||
traceevent | ||
argv_split.c | ||
bitmap.c | ||
ctype.c | ||
find_bit.c | ||
hweight.c | ||
rbtree.c | ||
str_error_r.c | ||
string.c | ||
vsprintf.c | ||
zalloc.c |