All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: Xenomai Mailing List <xenomai@xenomai.org>
Subject: Re: [Xenomai] Why does mqueue.h define mqd_t as unsigned
Date: Fri, 10 Apr 2015 16:50:35 +0200	[thread overview]
Message-ID: <20150410145035.GN20752@hermes.click-hack.org> (raw)
In-Reply-To: <20150410144410.GF29558@csclub.uwaterloo.ca>

On Fri, Apr 10, 2015 at 10:44:10AM -0400, Lennart Sorensen wrote:
> On Fri, Apr 10, 2015 at 12:17:18AM +0200, Gilles Chanteperdrix wrote:
> > This design is specified by POSIX. This looks like a "fighting the
> > windmill" case.
> 
> Yeah "Posix says so" always wins any argument it seems. :)

Adding #define MQ_FAILED ((mqd_t)-1) in your application and using
it makes your application portable. Adding it to Xenomai headers and
using it in your application makes your application non portable. If
the POSIX standard added this definition, then if you wanted your
application to be portable, you would want it to support previous
POSIX standards, so you would still add this definition to your
application (with an added ifdef on the posix standard level).

So, all and all, adding #define MQ_FAILED ((mqd_t)-1) to your
application and move on wins the argument.

-- 
					    Gilles.


      reply	other threads:[~2015-04-10 14:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 20:52 [Xenomai] Why does mqueue.h define mqd_t as unsigned Phil Mitchell
2015-04-09 21:07 ` Gilles Chanteperdrix
2015-04-10 18:55   ` Gilles Chanteperdrix
2015-04-09 21:11 ` Paul Janzen
2015-04-09 22:09   ` Lennart Sorensen
2015-04-09 22:17     ` Gilles Chanteperdrix
2015-04-09 22:29       ` Gilles Chanteperdrix
2015-04-09 23:17         ` Lowell Gilbert
2015-04-10 14:44       ` Lennart Sorensen
2015-04-10 14:50         ` Gilles Chanteperdrix [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=20150410145035.GN20752@hermes.click-hack.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=lsorense@csclub.uwaterloo.ca \
    --cc=xenomai@xenomai.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.