linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jaewon Kim <jaewon31.kim@samsung.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Jaewon Kim <jaewon31.kim@gmail.com>
Cc: Petr Mladek <pmladek@suse.com>,
	Jaewon Kim <jaewon31.kim@samsung.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	GyeongHwan Hong <gh21.hong@samsung.com>
Subject: RE: [RFC] vsprintf: compile error on %09pK
Date: Tue, 04 Apr 2023 19:16:06 +0900	[thread overview]
Message-ID: <20230404101606epcms1p531389fe1e59013e6dd6e5abebe1fc226@epcms1p5> (raw)
In-Reply-To: <20230403153458.GE12892@google.com>

>[..]
>> 
>> Okay, then we can't use %09pK. I've just wondered because %9pK works.
>
>This is not per printk / kernel, Wformat warnings come from the
>compiler.
>
>Per C11 (7.21.6 6):
> 0  For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, leading zeros
>    (following any indication of sign or base) are used to pad to the field width
>    rather than performing space padding
>    ...
>    For other conversions, the behavior is undefined.
>
>So using 0 for p should trigger an undefined behavior as far as the
>standard C concerned. Unless I'm missing something.

Thank your for the information about the leading 0 case. By the way do you know
if there is policy for none 0 digit like %9pK?

Jaewon Kim


      parent reply	other threads:[~2023-04-04 10:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p3>
2023-04-03 10:46 ` Jaewon Kim
2023-04-03 12:18   ` Sergey Senozhatsky
2023-04-03 12:53   ` Petr Mladek
2023-04-03 14:39     ` Jaewon Kim
2023-04-03 15:34       ` Sergey Senozhatsky
2023-04-03 16:04       ` David Laight
     [not found]       ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p6>
2023-04-04 10:12         ` Jaewon Kim
2023-04-04 12:03           ` Petr Mladek
     [not found]           ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p1>
2023-04-04 12:33             ` Jaewon Kim
     [not found]       ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p5>
2023-04-04 10:16         ` Jaewon Kim [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=20230404101606epcms1p531389fe1e59013e6dd6e5abebe1fc226@epcms1p5 \
    --to=jaewon31.kim@samsung.com \
    --cc=gh21.hong@samsung.com \
    --cc=jaewon31.kim@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pmladek@suse.com \
    --cc=senozhatsky@chromium.org \
    /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