[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94a81790-1385-43d4-ab67-9a6029e245de@t-8ch.de>
Date: Sat, 3 Aug 2024 20:29:14 +0200 (GMT+02:00)
From: Thomas Weißschuh <thomas@...ch.de>
To: Willy Tarreau <w@....eu>
Cc: Thomas Weißschuh <linux@...ssschuh.net>,
Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH 06/12] selftests/nolibc: avoid passing NULL to
printf("%s")
Aug 3, 2024 11:34:03 Willy Tarreau <w@....eu>:
> On Sun, Jul 28, 2024 at 12:10:00PM +0200, Thomas Weißschuh wrote:
>> Clang on higher optimization levels detects that NULL is passed to
>> printf("%s") and warns about it.
>> Avoid the warning.
>
> I don't see why this would be a problem, we do explicitly check for
> NULL in our printf implementation and print "(null)". Or maybe it is
> upset due to the attribute(printf) ? I don't know what the standard
> says regarding %s and NULL, though. If it says that NULL is forbidden
> then I can understand the warning and your fix is indeed correct. In
> any case it's not worth fighting with a compiler for nolibc-test, but
> it's probably worth mentioning in the commit message that it warns
> despite the check being already done.
It's undefined as per POSIX.
I'll update the commit message.
Powered by blists - more mailing lists