From: Rodrigo Campos <rodrigo@sdfg.com.ar>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Paul E. McKenney" <paulmck@kernel.org>
Cc: Willy Tarreau <w@1wt.eu>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/4] selftests/nolibc: Add tests for strlcat() and strlcpy()
Date: Fri, 26 Apr 2024 17:43:19 +0100 [thread overview]
Message-ID: <df7a2fde-9f6e-45bc-b691-3964b406db7c@sdfg.com.ar> (raw)
In-Reply-To: <172d25cf-cfd7-4069-8c26-df2e81ffbad1@t-8ch.de>
On 4/23/24 10:18 AM, Thomas Weißschuh wrote:
>> +#define EXPECT_STRBUFEQ(cond, expr, buf, val, cmp) \
>> + do { if (!(cond)) result(llen, SKIPPED); else ret += expect_str_buf_eq(expr, buf, val, llen, cmp); } while (0)
>> +
>> +static __attribute__((unused))
>> +int expect_str_buf_eq(size_t expr, const char *buf, size_t val, int llen, const char *cmp)
>> +{
>> + llen += printf(" = %lu <%s> ", expr, buf);
>
> This introduces a compiler warning on 32bit:
>
> i386-linux-gcc -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra -fno-stack-protector -m32 -mstack-protector-guard=global -fstack-protector-all -o nolibc-test \
> -nostdlib -nostdinc -static -Isysroot/i386/include nolibc-test.c nolibc-test-linkage.c -lgcc
> nolibc-test.c: In function 'expect_str_buf_eq':
> nolibc-test.c:610:30: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> 610 | llen += printf(" = %lu <%s> ", expr, buf);
> | ~~^ ~~~~
> | | |
> | | size_t {aka unsigned int}
> | long unsigned int
> | %u
>
>
> It is easy enough to fix through a cast to "unsigned long".
Thanks for fixing it! Of course, don't hesitate to let me know if there
is something I can help with :)
Best,
Rodrigo
next prev parent reply other threads:[~2024-04-26 16:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-18 19:51 [PATCH v3 0/4] Misc fixes for strlcpy() and strlcat() Rodrigo Campos
2024-02-18 19:51 ` [PATCH v3 1/4] tools/nolibc/string: export strlen() Rodrigo Campos
2024-02-18 19:51 ` [PATCH v3 2/4] tools/nolibc: Fix strlcat() return code and size usage Rodrigo Campos
2024-02-18 19:51 ` [PATCH v3 3/4] tools/nolibc: Fix strlcpy() " Rodrigo Campos
2024-02-18 19:51 ` [PATCH v3 4/4] selftests/nolibc: Add tests for strlcat() and strlcpy() Rodrigo Campos
2024-02-18 20:39 ` Rodrigo Campos
2024-02-18 21:11 ` Willy Tarreau
2024-02-18 21:41 ` Rodrigo Campos
2024-04-23 9:18 ` Thomas Weißschuh
2024-04-23 16:28 ` Willy Tarreau
2024-04-23 19:49 ` Paul E. McKenney
2024-04-26 16:43 ` Rodrigo Campos [this message]
2024-02-19 20:48 ` [PATCH v3 0/4] Misc fixes for strlcpy() and strlcat() Willy Tarreau
2024-02-20 19:25 ` Rodrigo Campos
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=df7a2fde-9f6e-45bc-b691-3964b406db7c@sdfg.com.ar \
--to=rodrigo@sdfg.com.ar \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=paulmck@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=w@1wt.eu \
/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
all inboxes | Powered by JetHome®