From: Willy Tarreau <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>,
Linux Kernel Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>,
Facebook Kernel Team <[email protected]>
Subject: Re: [PATCH v1 2/2] tools/nolibc/stdio: Add format attribute to enable printf warnings
Date: Fri, 20 May 2022 06:21:45 +0200 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On Fri, May 20, 2022 at 12:21:16AM +0700, Ammar Faizi wrote:
> From: Alviro Iskandar Setiawan <[email protected]>
>
> When we use printf and fprintf functions from the nolibc, we don't
> get any warning from the compiler if we have the wrong arguments.
> For example, the following calls will compile silently:
> ```
> printf("%s %s\n", "aaa");
> fprintf(stdout, "%s %s\n", "xxx", 1);
> ```
> (Note the wrong arguments).
>
> Those calls are undefined behavior. The compiler can help us warn
> about the above mistakes by adding a `printf` format attribute to
> those functions declaration.
I'm shocked I forgot it, I use it all the time, I'm even seeing this
as a bug fix for the series I sent. Thanks for fixing this mistake of
mine!
Acked-by: Willy Tarreau <[email protected]>
Willy
next prev parent reply other threads:[~2022-05-20 4:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-19 17:21 [PATCH v1 0/2] nolibc updates for Linux 5.20 Ammar Faizi
2022-05-19 17:21 ` [PATCH v1 1/2] tools/nolibc/stdlib: Support overflow checking for older compiler versions Ammar Faizi
2022-05-20 4:19 ` Willy Tarreau
2022-05-20 11:29 ` Alviro Iskandar Setiawan
2022-05-20 17:32 ` Paul E. McKenney
2022-05-19 17:21 ` [PATCH v1 2/2] tools/nolibc/stdio: Add format attribute to enable printf warnings Ammar Faizi
2022-05-20 4:21 ` Willy Tarreau [this message]
2022-05-20 4:23 ` [PATCH v1 0/2] nolibc updates for Linux 5.20 Willy Tarreau
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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