References: <304110a1193e48e8304b.1480401144@devws148.be.alcatel-lucent.com> From: Philippe Gerum Message-ID: <0e747fe3-ff40-5cd7-e24b-9bb68bcd7eee@xenomai.org> Date: Tue, 29 Nov 2016 09:55:35 +0100 MIME-Version: 1.0 In-Reply-To: <304110a1193e48e8304b.1480401144@devws148.be.alcatel-lucent.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] [PATCH] psos.h: remove dependency on tunables.h List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ronny Meeus , xenomai@xenomai.org On 11/29/2016 07:32 AM, Ronny Meeus wrote: > The psos.h file pollutes the application's namespace with defines > of the boilerplate code because the tunables.h is included. In our > application we already have a definition of the list_entry macro, > resulting in a redefinition. The psos.h should be kept clean. > > Following small test program clearly shows the issue: > > #include > #define list_entry > int main(int argc, char * const argv[]) > { > return 0; > } > > When compiling the code above a warning is generated: > > simple_test.c:3:1: warning: "list_entry" redefined > In file included from boilerplate/list.h:24, > from boilerplate/setup.h:21, > from boilerplate/tunables.h:22, > from psos/psos.h:28, > from simple_test.c:1: > boilerplate/shared-list.h:233:1: warning: this is the location of the previous definition > > This patch resolves the issue by just removing the dependency > and all related functions. If the functions are actually needed, better to > move them in a separate header file since they are not part of the 'official' > psos interface. > > diff --git a/include/psos/psos.h b/include/psos/psos.h > --- a/include/psos/psos.h > +++ b/include/psos/psos.h > @@ -25,7 +25,6 @@ > #define _XENOMAI_PSOS_PSOS_H > Ack. But then we'd also need to introduce psos/tunables.h for defining the bits your patch removes from psos/psos.h. -- Philippe.