lkml.org 
[lkml]   [2023]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [RFC] vsprintf: compile error on %09pK
From
Date
>[..]
>>
>> 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

\
 
 \ /
  Last update: 2023-04-04 12:17    [W:0.082 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site