From: Linus Torvalds <firstname.lastname@example.org> To: Joe Perches <email@example.com> Cc: Louis Taylor <firstname.lastname@example.org>, David Howells <email@example.com>, firstname.lastname@example.org, Linux List Kernel Mailing <email@example.com>, firstname.lastname@example.org Subject: Re: [PATCH] afs: use correct format characters Date: Thu, 11 Apr 2019 09:31:33 -0700 [thread overview] Message-ID: <CAHk-=wgoxnmsj8GEVFJSvTwdnWm8wVJthefNk2n6+4TC=20e0Q@mail.gmail.com> (raw) In-Reply-To: <email@example.com> On Wed, Apr 10, 2019 at 4:01 PM Joe Perches <firstname.lastname@example.org> wrote: > > I really think this clang message should be ignored. Agreed. > It's really unnecessary as every vararg argument smaller > than int size is already promoted to int. Exactly. It's a pointless warning, making for more complex code, and making people remember esoteric printf format details that have no reason for existing. The "h" and "hh" things should never be used. The only reason for them being used if if you have an "int", but you want to print it out as a "char" (and honestly, that is a really bad reason, you'd be better off just using a proper cast to make the code more obvious). So if what you have a "char" (or unsigned char) you should always just print it out as an "int", knowing that the compiler already did the proper type conversion. Linus
next prev parent reply other threads:[~2019-04-11 16:31 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-10 22:03 Louis Taylor 2019-04-10 22:27 ` Nick Desaulniers 2019-04-10 22:41 ` [PATCH v2] " Louis Taylor 2019-04-10 22:52 ` Nick Desaulniers 2019-04-12 15:48 ` David Laight 2019-04-10 23:00 ` [PATCH] " Joe Perches 2019-04-11 16:31 ` Linus Torvalds [this message] 2019-04-11 17:41 ` Nick Desaulniers
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='CAHk-=wgoxnmsj8GEVFJSvTwdnWm8wVJthefNk2n6+4TC=20e0Q@mail.gmail.com' \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH] afs: use correct format characters' \ /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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).