Re: [PATCH 0/2] clean up some MAYBE_UNUSED cases

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

 



Jeff King <peff@xxxxxxxx> writes:

>   - builtin/gc.c's check_crontab_process(). The whole function is marked
>     as MAYBE_UNUSED here, which is a little funny. It's because
>     is_crontab_available() may or may not call us based on __APPLE__.
>     Should we conditionally define the function, too, in that case? It
>     would mean repeating the #ifdef. Alternatively, we could define it
>     like this:
>
>       #ifdef __APPLE__
>       static int check_crontab_process(const char *cmd UNUSED)
>       {
>               return 0;
>       }
>       #else
>       static int check_crontab_process(const char *cmd UNUSED)
>       {
>               [...the real function...]
>       }
>       #endif

Or inline the body of check_crontab_process() at its sole callsite
(the other side of "#ifdef APPLE") in is_crontab_available() and get
rid of check_crontab_process().

>     But I think we're getting into "well, this is how I would have
>     written it" territory, and it doesn't matter much either way in
>     practice. It's probably better to just leave it alone.

OK.




[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