[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdkEjrPUL4HuO3UKaUZAzVw=XV1bEOSj6HR5R1WTUSSZ4w@mail.gmail.com>
Date: Fri, 18 Mar 2022 11:01:13 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Bill Wendling <morbo@...gle.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Nathan Chancellor <nathan@...nel.org>,
linux-gpio@...r.kernel.org, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
Joe Perches <joe@...ches.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] gpiolib: acpi: use correct format characters
On Fri, Mar 18, 2022 at 7:04 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Thu, Mar 17, 2022 at 11:11:21AM -0700, Nick Desaulniers wrote:
> > Our goal is to enable -Wformat for CC=clang. Please see also:
> > commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
> > unnecessary %h[xudi] and %hh[xudi]")
>
> Not that I agree on that commit for %h[h]x
>
> signed char ch = -1;
> printf("%x\n", ch);
> printf("%hhx\n", ch);
Will print:
ffffffff
ff
Maybe we should reconsider our recommendations for signed types?
It's probably worth adding `signed char` explicitly to
Documentation/core-api/printk-formats.rst, as it is a distinct type
from `char` in C.
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists