• Re: [gentoo-user] gentoo-sources-6.14.6 build error

    From =?UTF-8?b?enl4aGVyZfCfkq0=?=@21:1/5 to mentadent47@yahoo.com on Sat May 10 20:20:01 2025
    On Sat, May 10 2025 at 20:09:42 +02:00:00, yahoo
    <mentadent47@yahoo.com> wrote:
    Anybody else seeing this?

    error: initializer-string for array of æcharÆ truncates NUL
    terminator but destination lacks ænonstringÆ attribute (8 chars
    into 7 available) [-Werror=unterminated-string-initialization]


    $ gcc --version
    gcc (Gentoo Hardened 15.1.0 p55) 15.1.0

    thanks,

    raffaele
    https://bugs.gentoo.org/955773

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From yahoo@21:1/5 to All on Sat May 10 20:20:01 2025
    Anybody else seeing this?

    error: initializer-string for array of ‘char’ truncates NUL terminator
    but destination lacks ‘nonstring’ attribute (8 chars into 7 available) [-Werror=unterminated-string-initialization]


    $ gcc --version
    gcc (Gentoo Hardened 15.1.0 p55) 15.1.0

    thanks,

    raffaele

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Eldredge@21:1/5 to All on Sat May 10 21:40:02 2025
    I had this error when building (if I remember correctly) libxcrypt for the initrd with genkernel. But genkernel is now obsolete, so I set it aside until I get around to switching my kernel bulids to a more modern setup.

    It looks like this warning was added in the recently-released GCC 15. It's not enabled by default or with -Wall, only with -Wextra. But apparently libxcrypt was being built with -Wextra -Werror so it breaks the build.

    It triggers on code like

    char foo[4] = "1234";

    which is perfectly legal but results in `foo` not containing a final null byte. In my experience this is usually deliberate, for cases where the array will not be used as a string and does not need the final null. But this new option in GCC 15 will
    warn about it, unless marked with __attribute__((nonstring)). This attribute in turn will cause the compiler to warn if the array is ever passed to a function which is known to expect a null-terminated (str*, printf, etc)

    I expect we are going to see a lot of this issue as people start building things with the new GCC.

    IMHO this is an example of why -Werror is not a good idea for end-user build processes. If you want to use it in your CI to adopt GCC's nitpickiest opinions of "suspicious code" as your own coding standards, fine; but as here, it can make your source
    releases gratuitously incompatible with future compilers that would otherwise work just fine for end users.

    On May 10, 2025, at 12:09, yahoo <mentadent47@yahoo.com> wrote:

    Anybody else seeing this?

    error: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (8 chars into 7 available) [-Werror=unterminated-string-initialization]


    $ gcc --version
    gcc (Gentoo Hardened 15.1.0 p55) 15.1.0

    thanks,

    raffaele


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From yahoo@21:1/5 to All on Mon May 12 18:50:01 2025
    Il 10/05/25 21:36, Nate Eldredge ha scritto:
    I had this error when building (if I remember correctly) libxcrypt for the initrd with genkernel. But genkernel is now obsolete, so I set it aside until I get around to switching my kernel bulids to a more modern setup.

    It looks like this warning was added in the recently-released GCC 15. It's not enabled by default or with -Wall, only with -Wextra. But apparently libxcrypt was being built with -Wextra -Werror so it breaks the build.


    Thanks, for the kernel it is the CONFIG_WERROR option that causes the
    build to fail. I temporarily disabled it.

    raf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)