qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Stefan Weil <sw@weilnetz.de>
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 16:23:56 -0500	[thread overview]
Message-ID: <4FFC9D6C.6090306@codemonkey.ws> (raw)
In-Reply-To: <4FFC9AAE.50609@weilnetz.de>

On 07/10/2012 04:12 PM, Stefan Weil wrote:
> 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.

You're reading the docs too literally:

http://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf.c;h=d5690342536bc8cf948c786f663bb63f73f91f3a;hb=HEAD#l966

It uses strerror_r() and is thread-safe.  Converting to strerror() removes that 
safety.

Regards,

Anthony Liguori

  reply	other threads:[~2012-07-10 21:24 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
2012-07-10 21:23       ` Anthony Liguori [this message]
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=4FFC9D6C.6090306@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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;
as well as URLs for NNTP newsgroup(s).