Re: [PATCH] simple-ipc: correct ifdefs when NO_PTHREADS is defined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff Hostetler <git@xxxxxxxxxxxxxxxxx> writes:

>>>   #ifdef NO_UNIX_SOCKETS
>>>   #error compat/simple-ipc/ipc-unix-socket.c requires Unix sockets
>>>   #endif
>>>   +#ifdef NO_PTHREADS
>>> +#error compat/simple-ipc/ipc-unix-socket.c requires pthreads
>>> +#endif
>>> +
>> Do we want to duplicate the requirement here and risk them drifting
>> apart?
>>  ...
> Would it be better to just have something like the following at the
> top of the source files and leave the details to the Makefile:
>
>
> #ifndef SUPPORTS_SIMPLE_IPC
> /*
>  * This source file should only be included when Simple IPC
>  * is supported.  See the top-level Makefile.
>  */
> #error SUPPORTS_SIMPLE_IPC not defined
> #endif

Yeah, that is a much better message, with even less duplication,
than what I sent.

I do not think #ifndef/#error/#endif adds much value, though.  After
all, the Makefile does not even tell us to feed this file to the
compiler when the C preprocessor macro is not defined, so presumably
whoever hits the #error knows s/he is doing something not supported,
and the point of the new message is to help those who we failed by
leaving the rest of the source file unbuildable even when we defined
the C preprocessor macro in the Makefile (like the mistaken
dependency on pthreads that we missed).

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux