qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Fam Zheng" <fam@euphon.net>, "Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Kostiantyn Kostiuk" <kkostiuk@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	qemu-stable <qemu-stable@nongnu.org>,
	"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH v3] Fix const qualifier build errors with recent glibc
Date: Wed, 10 Dec 2025 11:50:06 +0100	[thread overview]
Message-ID: <d57fe2bb-7e54-4c6c-beab-303eae81001c@redhat.com> (raw)
In-Reply-To: <31843643-a22d-4634-9eb7-868376e57635@tls.msk.ru>

On 12/10/25 11:35, Michael Tokarev wrote:
> On 12/9/25 20:43, Cédric Le Goater wrote:
>> A recent change in glibc 2.42.9000 [1] changes the return type of
>> strstr() and other string functions to be 'const char *' when the
>> input is a 'const char *'.
>>
>> This breaks the build in various files with errors such as :
>>
>>    error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>>      208 |         char *pidstr = strstr(filename, "%");
>>          |                        ^~~~~~
>>
>> Fix this by changing the type of the variables that store the result
>> of these functions to 'const char *'.
>>
>> [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=cd748a63ab1a7ae846175c532a3daab341c62690
> 
> I'm picking this up for qemu-stable (10.0 & 10.1 series)
> (together with 83f6dceb8f5c "qga: Fix ubsan warning").
> Please let me know if I shouldn't.

This is a partial fix for the recent glibc update. We need at least
two other patches. One rewriting vubr_parse_host_port() as Peter
proposed and another for :

../hw/i386/x86-common.c:827:11: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   827 |     vmode = strstr(kernel_cmdline, "vga=");

which is missing in v3.

Anyhow, there is no harm in taking this first part. Future backports
should be simple enough.

Thanks,

C.



      reply	other threads:[~2025-12-10 10:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 17:43 [PATCH v3] Fix const qualifier build errors with recent glibc Cédric Le Goater
2025-12-09 18:56 ` Peter Maydell
2025-12-09 19:17 ` Philippe Mathieu-Daudé
2025-12-09 20:07   ` Philippe Mathieu-Daudé
2025-12-10  6:03   ` Cédric Le Goater
2025-12-10 10:35 ` Michael Tokarev
2025-12-10 10:50   ` Cédric Le Goater [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d57fe2bb-7e54-4c6c-beab-303eae81001c@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=kkostiuk@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).