All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: tiwai@suse.com, shuah@kernel.org, alsa-devel@alsa-project.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	skhan@linuxfoundation.org
Subject: Re: [PATCH] Fix snprintf format warnings during 'alsa' kselftest compilation
Date: Mon, 27 Feb 2023 14:12:00 +0000	[thread overview]
Message-ID: <Y/y6MNh8yXcsQWWj@sirena.org.uk> (raw)
In-Reply-To: <1db3bfe5-0982-b445-9c94-784478279028@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 663 bytes --]

On Thu, Feb 23, 2023 at 11:14:56PM +0300, Ivan Orlov wrote:

> I compiled the test via gcc 11.3.0 without any custom options, the arch is
> x86_64. There were five warnings during the test compilation, and all of
> them were caused by incorrect format in 'snprintf' function calls. As I
> know, using incorrect format in 'snprintf' creates an undefined behavior.
> Maybe there is a point to fix it?

The question is more where does the warning come from and is this a good
fix - a common pattern where generic types like size_t get used is that
the underlying type changes between platforms and warnings just get
moved about by changing the printf format around.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, shuah@kernel.org,
	alsa-devel@alsa-project.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, skhan@linuxfoundation.org
Subject: Re: [PATCH] Fix snprintf format warnings during 'alsa' kselftest compilation
Date: Mon, 27 Feb 2023 14:12:00 +0000	[thread overview]
Message-ID: <Y/y6MNh8yXcsQWWj@sirena.org.uk> (raw)
In-Reply-To: <1db3bfe5-0982-b445-9c94-784478279028@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 663 bytes --]

On Thu, Feb 23, 2023 at 11:14:56PM +0300, Ivan Orlov wrote:

> I compiled the test via gcc 11.3.0 without any custom options, the arch is
> x86_64. There were five warnings during the test compilation, and all of
> them were caused by incorrect format in 'snprintf' function calls. As I
> know, using incorrect format in 'snprintf' creates an undefined behavior.
> Maybe there is a point to fix it?

The question is more where does the warning come from and is this a good
fix - a common pattern where generic types like size_t get used is that
the underlying type changes between platforms and warnings just get
moved about by changing the printf format around.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-02-27 14:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23 14:32 [PATCH] Fix snprintf format warnings during 'alsa' kselftest compilation Ivan Orlov
2023-02-23 15:05 ` Mark Brown
2023-02-23 15:05   ` Mark Brown
2023-02-23 20:14   ` Ivan Orlov
2023-02-23 20:14     ` Ivan Orlov
2023-02-27 14:12     ` Mark Brown [this message]
2023-02-27 14:12       ` Mark Brown

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=Y/y6MNh8yXcsQWWj@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=ivan.orlov0322@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.