All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/5] Avoid unportable %m format
Date: Tue, 10 Jul 2012 23:12:14 +0200	[thread overview]
Message-ID: <4FFC9AAE.50609@weilnetz.de> (raw)
In-Reply-To: <4FFC9643.7020509@codemonkey.ws>

Am 10.07.2012 22:53, schrieb Anthony Liguori:
> On 07/08/2012 06:51 AM, blauwirbel@gmail.com wrote:
>> From: Blue Swirl<blauwirbel@gmail.com>
>>
>> Replace %m format with explicit call to standard strerror().
>>
>> Signed-off-by: Blue Swirl<blauwirbel@gmail.com>
>
> I would expect '%m' to be thread safe whereas strerror() isn't.  I 
> don't think this change is actually good.
>
> You'd need to do something more clever with strerror_r() to be 
> equivalent.
>
> Regards,
>
> Anthony Liguori
>

Extract from the Linux manpage PRINTF(3):

        m      (Glibc extension.)  Print output of strerror(errno).  No 
argument is required.

The patch should result in identical behaviour with Glibc.
It improves the situation for all platforms which don't use Glibc.

In theory, strerror_r() might be more correct, but in the typical practical
scenarios (error output before abort) it is not really needed.

Regards,

Stefan Weil

  reply	other threads:[~2012-07-10 21:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-08 11:51 [Qemu-devel] [PATCH 0/5] portability patches blauwirbel
2012-07-08 11:51 ` [Qemu-devel] [PATCH 1/5] Avoid GCC extension ?: blauwirbel
2012-07-08 12:09   ` Andreas Schwab
2012-07-08 12:14     ` Blue Swirl
2012-07-11 12:54     ` Kevin Wolf
2012-07-11 13:09       ` Peter Maydell
2012-07-11 13:12         ` 陳韋任 (Wei-Ren Chen)
2012-07-12 20:34           ` Blue Swirl
2012-07-12 20:28       ` Blue Swirl
2012-07-12 21:08         ` Peter Maydell
2012-07-13 14:47           ` Blue Swirl
2012-07-13  9:05         ` Kevin Wolf
2012-07-13 14:58           ` Blue Swirl
2012-07-09  7:35   ` Markus Armbruster
2012-07-10 19:09     ` Blue Swirl
2012-07-08 11:51 ` [Qemu-devel] [PATCH 2/5] Avoid returning void blauwirbel
2012-07-08 11:51 ` [Qemu-devel] [PATCH 3/5] Use __asm__ instead of asm or __asm blauwirbel
2012-07-08 11:51 ` [Qemu-devel] [PATCH 4/5] Avoid unportable %m format blauwirbel
2012-07-10 20:53   ` Anthony Liguori
2012-07-10 21:12     ` Stefan Weil [this message]
2012-07-10 21:23       ` Anthony Liguori
2012-07-12 19:43     ` Blue Swirl
2012-07-08 11:51 ` [Qemu-devel] [PATCH 5/5] Avoid redefining inline blauwirbel

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=4FFC9AAE.50609@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.