Bad Practice
Bad Practice
Posted Apr 24, 2025 16:42 UTC (Thu) by JanSoundhouse (subscriber, #112627)Parent article: Some __nonstring__ turbulence
Maybe someone can help and setup some basic actions for him on his github repo?
Posted Apr 25, 2025 6:49 UTC (Fri)
by mathstuf (subscriber, #69389)
[Link]
Posted Apr 25, 2025 8:14 UTC (Fri)
by jlargentaye (subscriber, #75206)
[Link]
> Maybe someone can help and setup some basic actions for him on his github repo?
Surely you're joking. Or are you unaware of his poor opinion of GitHub's every design decision? To make it clear, the GitHub Linux repo is offered only as a read-only mirror.
Posted Apr 25, 2025 15:38 UTC (Fri)
by rweikusat2 (subscriber, #117920)
[Link] (5 responses)
Posted Apr 25, 2025 16:19 UTC (Fri)
by pbonzini (subscriber, #60935)
[Link] (4 responses)
Posted Apr 25, 2025 17:21 UTC (Fri)
by rweikusat2 (subscriber, #117920)
[Link] (3 responses)
The very point of having a release candidate is to enable testing by others. It's not a release and bugs are expected.
Posted Apr 25, 2025 18:21 UTC (Fri)
by marcH (subscriber, #57642)
[Link]
Come on, failure to compile (!) with everything except a pre-release GCC is absolutely not expected from a _release candidate_. Yes, people are expected to test release candidates and find bugs but they are not expected to waste everyone's time with that sort of issue in 2025. This steals from actual test time.
Posted Apr 25, 2025 18:45 UTC (Fri)
by mussell (subscriber, #170320)
[Link]
Posted Apr 26, 2025 8:42 UTC (Sat)
by jwakely (subscriber, #60262)
[Link]
Using new features needs to be gated on version checks or feature test macro checks (e.g. using __has_attribute). This has nothing to do with whether you're using a snapshot from two weeks before the GCC 15 release or you're using the final GCC 15.1 release, the behaviour is the same, because it's not a bug in some unstable early development preview. It's the expected behaviour of GCC 15.
Bad Practice
Bad Practice
Bad Practice
Bad Practice
Bad Practice
Bad Practice
So right now if you try to build the 6.15-rc3 tag with GCC 14 and CONFIG_WERROR, the error you will get is
The Error of -Werror
And the GCC documentation for nonstring, says that
/media/net/src/linux/drivers/acpi/tables.c:399:1: error: ‘nonstring’ attribute ignored on objects of type ‘const char[][4]’ [-Werror=attributes]
399 | static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst __nonstring = {
The nonstring variable attribute specifies that an object or member declaration with type array of char, signed char, or unsigned char, or pointer to such a type is intended to store character arrays that do not necessarily contain a terminating NUL.
According to the C standard (and contrary to popular belief), char* and char[] are two distinct types as the latter has storage associated with it (ie. in .rodata) while the former is a single machine word (assuming pointers are represented by machine words.) What seems to have changed in GCC 15 is that you can now declare an array of char arrays as nonstring. On older compilers, trying to use an attribute where it can't be used gives a warning from -Wattributes, which is upgraded to an error by -Werror.
From my perspective, GCC did the right thing by allowing nonstring to be applied to char[][] since it aligns with programmers' expectations that char*[] and char[][] are basically the same. In fact, I consider <GCC 15's behaviour a bug and I see no reason not to backport this change to earlier versions. Really this is just -Werror doing -Werror things.
Bad Practice
