All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] gnuradio: stat.h is need for mode_t
Date: Sat, 29 Aug 2015 15:53:48 +0200	[thread overview]
Message-ID: <20150829155348.436b42e2@free-electrons.com> (raw)
In-Reply-To: <20150829155227.54561ee9@x230.trabucayre.com>

Hello,

On Sat, 29 Aug 2015 15:52:27 +0200, gwenhael.goavec wrote:

> > mode_t is according to the standard
> > (http://pubs.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html)
> > defined in <sys/types.h>. Can you try including <sys/types.h> instead?
> > 
> Ok It's working with sys/types.h

Good.

> > If that works as well, then please submit the patch upstream: it is
> > valid for all toolchains.
> > 
> I've checked all the autobuild for 07/2015 and 08/2015. The missing
> mode_t only appears if the toolchain is based on musl.

Yes. It's just because with uClibc and glibc, <sys/types.h> is pulled
in by another header that gets included by gnuradio.

However, using mode_t without <sys/types.h> is incorrect. It happens to
be working by chance with uClibc and glibc, but is not technically
correct: as the POSIX standard specifies, mode_t is defined in
<sys/types.h>, so this file should be included when mode_t is used.

See
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

So the fix of including <sys/types.h> is not musl specific at all. It
makes the code more correct.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

      reply	other threads:[~2015-08-29 13:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28 14:47 [Buildroot] [PATCH 1/1] gnuradio: stat.h is need for mode_t Gwenhael Goavec-Merou
2015-08-28 15:09 ` Vicente Olivert Riera
2015-08-28 15:27   ` gwenhael.goavec
2015-08-28 17:31 ` Thomas Petazzoni
2015-08-29 13:52   ` gwenhael.goavec
2015-08-29 13:53     ` Thomas Petazzoni [this message]

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=20150829155348.436b42e2@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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.