qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>, Houcheng Lin <houcheng@gmail.com>
Cc: peter.maydell@linaro.org, famz@redhat.com, kvm@vger.kernel.org,
	linhaocheng@itri.org.tw, qemu-devel@nongnu.org,
	pbonzini@redhat.com, alex.bennee@linaro.org
Subject: Re: [Qemu-devel] [RFC PATCH v4] os-android: Add support to android platform
Date: Tue, 6 Oct 2015 06:13:10 -0600	[thread overview]
Message-ID: <5613BAD6.9090605@redhat.com> (raw)
In-Reply-To: <20151006094713.GD19089@stefanha-thinkpad>

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

On 10/06/2015 03:47 AM, Stefan Hajnoczi wrote:
> On Sat, Oct 03, 2015 at 12:44:14PM +0800, Houcheng Lin wrote:
>> diff --git a/configure b/configure
>> index d7c24cd..cda88c1 100755

>> +++ b/include/qemu/osdep.h
>> @@ -74,6 +74,14 @@ typedef unsigned int            uint_fast16_t;
>>  typedef signed int              int_fast16_t;
>>  #endif
>>  
>> +#ifdef CONFIG_ANDROID
>> +/*
>> + * For include the basename prototyping in android.
>> + */
>> +#include <libgen.h>
> 
> Files that use basename(3) should include libgen.h.  Why include it
> here?

What is using basename(3)? POSIX gives basename(3) a worthless contract
- it is free to return non-thread-safe storage.  Also, it is not
portable to Windows-style drive-letters, so I consider any code using
<libgen.h> to already be suspect.

If you are already writing code to be ported to both Unixy and windows
systems, you are better off rolling your own alternative to basename (or
better, using something else that has already rolled a portable version
for you - while I know gnulib does that, we aren't using gnulib; but I
assume glib has something along those lines even though I haven't looked
for it).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  parent reply	other threads:[~2015-10-06 12:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03  4:44 [Qemu-devel] [RFC PATCH v4] os-android: Add support to android platform Houcheng Lin
2015-10-06  9:47 ` Stefan Hajnoczi
2015-10-06 10:56   ` Paolo Bonzini
2015-10-06 12:13   ` Eric Blake [this message]
2015-10-06 13:22     ` Paolo Bonzini
2015-10-07  2:05       ` Houcheng Lin

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=5613BAD6.9090605@redhat.com \
    --to=eblake@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=famz@redhat.com \
    --cc=houcheng@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linhaocheng@itri.org.tw \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).