Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Dec 2025 14:49:36 +0000
From:      Nuno Teixeira <eduardo@freebsd.org>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org
Subject:   Re: git: e2c93ed09f25 - main - sys/font.h: avoid warnings about too-long initializer strings
Message-ID:  <CAFDf7ULL=yTWXmD946XX-t45aEsfoWbys0q=SBTcwkSagj4hrA@mail.gmail.com>
In-Reply-To: <694e9c7d.3cfe6.7a265e1e@gitrepo.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hello Dimitry,

I've just spoted by luck that world fails at this commit:

Building
/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.sbin/zic/_debuginstall
In file included from /usr/src/usr.bin/vtfontcvt/vtfontcvt.c:32:
/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/include/sys/font.h:111:22:
error: expected ';' at end of declaration list
  111 |         uint8_t         fh_magic[8] __nonstring;
      |                                    ^
      |                                    ;

Cheers,

Dimitry Andric <dim@freebsd.org> escreveu (sexta, 26/12/2025 à(s) 14:32):

> The branch main has been updated by dim:
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=e2c93ed09f259ed049923bdaa9b697b3586e2f1a
>
> commit e2c93ed09f259ed049923bdaa9b697b3586e2f1a
> Author:     Dimitry Andric <dim@FreeBSD.org>
> AuthorDate: 2025-12-26 14:31:43 +0000
> Commit:     Dimitry Andric <dim@FreeBSD.org>
> CommitDate: 2025-12-26 14:32:09 +0000
>
>     sys/font.h: avoid warnings about too-long initializer strings
>
>     Mark `font_header::fh_magic` as `__non_string`, to avoid a warning from
>     clang 21 similar to:
>
>         /usr/src/usr.bin/vtfontcvt/vtfontcvt.c:763:15: error:
> initializer-string for character array is too long, array size is 8 but
> initializer has size 9 (including the null terminating character); did you
> mean to use the 'nonstring' attribute?
> [-Werror,-Wunterminated-string-initialization]
>           763 |                 .fh_magic = FONT_HEADER_MAGIC,
>               |                             ^~~~~~~~~~~~~~~~~
>         /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/font.h:109:27:
> note: expanded from macro 'FONT_HEADER_MAGIC'
>           109 | #define FONT_HEADER_MAGIC       "VFNT0002"
>               |                                 ^~~~~~~~~~
>
>     MFC after:      3 days
> ---
>  sys/sys/font.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sys/sys/font.h b/sys/sys/font.h
> index fb5fbbc9e557..d486dbc3a011 100644
> --- a/sys/sys/font.h
> +++ b/sys/sys/font.h
> @@ -108,7 +108,7 @@ typedef STAILQ_HEAD(font_list, fontlist) font_list_t;
>
>  #define        FONT_HEADER_MAGIC       "VFNT0002"
>  struct font_header {
> -       uint8_t         fh_magic[8];
> +       uint8_t         fh_magic[8] __nonstring;
>         uint8_t         fh_width;
>         uint8_t         fh_height;
>         uint16_t        fh_pad;
>
>

-- 
Nuno Teixeira
FreeBSD UNIX:  <eduardo@FreeBSD.org>   Web:  https://FreeBSD.org

[-- Attachment #2 --]
<div dir="ltr"><div>Hello Dimitry,<br><br></div>I&#39;ve just spoted by luck that world fails at this commit:<br><br>Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.sbin/zic/_debuginstall<br>In file included from /usr/src/usr.bin/vtfontcvt/vtfontcvt.c:32:<br>/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/include/sys/font.h:111:22: error: expected &#39;;&#39; at end of declaration list<br>  111 |         uint8_t         fh_magic[8] __nonstring;<br>      |                                    ^<br>      |                                    ;<br><div><br></div><div>Cheers,</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Dimitry Andric &lt;<a href="mailto:dim@freebsd.org">dim@freebsd.org</a>&gt; escreveu (sexta, 26/12/2025 à(s) 14:32):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The branch main has been updated by dim:<br>
<br>
URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=e2c93ed09f259ed049923bdaa9b697b3586e2f1a" rel="noreferrer" target="_blank">https://cgit.FreeBSD.org/src/commit/?id=e2c93ed09f259ed049923bdaa9b697b3586e2f1a</a><br>;
<br>
commit e2c93ed09f259ed049923bdaa9b697b3586e2f1a<br>
Author:     Dimitry Andric &lt;dim@FreeBSD.org&gt;<br>
AuthorDate: 2025-12-26 14:31:43 +0000<br>
Commit:     Dimitry Andric &lt;dim@FreeBSD.org&gt;<br>
CommitDate: 2025-12-26 14:32:09 +0000<br>
<br>
    sys/font.h: avoid warnings about too-long initializer strings<br>
<br>
    Mark `font_header::fh_magic` as `__non_string`, to avoid a warning from<br>
    clang 21 similar to:<br>
<br>
        /usr/src/usr.bin/vtfontcvt/vtfontcvt.c:763:15: error: initializer-string for character array is too long, array size is 8 but initializer has size 9 (including the null terminating character); did you mean to use the &#39;nonstring&#39; attribute? [-Werror,-Wunterminated-string-initialization]<br>
          763 |                 .fh_magic = FONT_HEADER_MAGIC,<br>
              |                             ^~~~~~~~~~~~~~~~~<br>
        /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/font.h:109:27: note: expanded from macro &#39;FONT_HEADER_MAGIC&#39;<br>
          109 | #define FONT_HEADER_MAGIC       &quot;VFNT0002&quot;<br>
              |                                 ^~~~~~~~~~<br>
<br>
    MFC after:      3 days<br>
---<br>
 sys/sys/font.h | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/sys/sys/font.h b/sys/sys/font.h<br>
index fb5fbbc9e557..d486dbc3a011 100644<br>
--- a/sys/sys/font.h<br>
+++ b/sys/sys/font.h<br>
@@ -108,7 +108,7 @@ typedef STAILQ_HEAD(font_list, fontlist) font_list_t;<br>
<br>
 #define        FONT_HEADER_MAGIC       &quot;VFNT0002&quot;<br>
 struct font_header {<br>
-       uint8_t         fh_magic[8];<br>
+       uint8_t         fh_magic[8] __nonstring;<br>
        uint8_t         fh_width;<br>
        uint8_t         fh_height;<br>
        uint16_t        fh_pad;<br>
<br>
</blockquote></div><div><br clear="all"></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><font color="#888888">Nuno Teixeira</font></div><div><div><font color="#888888">
FreeBSD UNIX:  &lt;eduardo@FreeBSD.org&gt;   Web:  <a href="https://FreeBSD.org" rel="noreferrer" target="_blank">https://FreeBSD.org</a><br></font></div></div></div></div>;
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7ULL=yTWXmD946XX-t45aEsfoWbys0q=SBTcwkSagj4hrA>