From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 10 Apr 2015 16:50:35 +0200 From: Gilles Chanteperdrix Message-ID: <20150410145035.GN20752@hermes.click-hack.org> References: <20150409220956.GE29558@csclub.uwaterloo.ca> <20150409221718.GI20752@hermes.click-hack.org> <20150410144410.GF29558@csclub.uwaterloo.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150410144410.GF29558@csclub.uwaterloo.ca> Subject: Re: [Xenomai] Why does mqueue.h define mqd_t as unsigned List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lennart Sorensen Cc: Xenomai Mailing List 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.