Closed alviroiskandar closed 1 year ago
Hi @alviroiskandar, thank you for the patch!
I am curious, under what conditions do you see this warning? It comes from -Wgnu
, which we explicitly disable in the main Makefile because we build with -std=gnu89
, which means we are going to take advantage of GNU extensions. While fixing this one warning is fine, we want to make sure that every part of the kernel has the same set of warnings disabled.
@kees and @GustavoARSilva might have some thoughts on the patch, as they have been trying to clean up the usage of flexible arrays throughout the kernel. One small comment off the bat, that comment at the end of the structure should probably be above the union, as that is a more standard location.
On Tue, Feb 8, 2022 at 11:57 PM Nathan Chancellor wrote:
Hi @alviroiskandar, thank you for the patch!
I am curious, under what conditions do you see this warning? It comes from -Wgnu, which we explicitly disable in the main Makefile because we build with -std=gnu89, which means we are going to take advantage of GNU extensions. While fixing this one warning is fine, we want to make sure that every part of the kernel has the same set of warnings disabled.
Ahh right, sorry.
The build is actually not relevant with the config provided from upstream, not sure if my patch is acceptable under that situation. If it is not, let's close this.
After reconsidering the condition, I think it seems it is not really reasonable since the upstream tree builds just fine. So my excuse "clang warns this" is not valid as we intentionally disable that warning.
@kees and @GustavoARSilva might have some thoughts on the patch, as they have been trying to clean up the usage of flexible arrays throughout the kernel. One small comment off the bat, that comment at the end of the structure should probably be above the union, as that is a more standard location.
I actually copied the comment style and sentence from sched.h.
But I agree to have them be above the union, though. If this patch looks reasonable, I will spin the v2 with that change folded in.
Thx
-- Viro
I think this issue is stale, but I'm not sure precisely that this has been fixed, or when. Looks a bit like #113 and #1101 which are both closed.
-Wgnu
is disabled unconditionally in Makefile
so it seems likely that this may have been caused by a cc-option
failure.
Closing this as it's not reproducible anymore... It seems it was just a bad setup from my end.
Hello @nickdesaulniers, @nathanchance
Could you review this patch? Not submitted yet, what do you think?