Re: (void)foo or __unused foo ?

From: Erich Dollansky <erichfreebsdlist_at_ovitrap.com>
Date: Fri, 27 Jul 2012 16:47:15 +0700
Hi,

On Fri, 27 Jul 2012 11:38:24 +0200
Luigi Rizzo <rizzo_at_iet.unipi.it> wrote:

> In writing cross platform code I often have to deal with function
> arguments or variables that are not used on certain platforms.
> In FreeBSD:sys/cdefs.h we have
> 
if I understand you right here, it is you own code that has to run on
different platforms.

I can only tell what we are doing since a long long time. We have one
file which handles all these things in one central location.

This makes all other files independent of the platform but this one
file might needs some work when a new platform comes in or things
change on one platform.

> Any disadvantage or objection to selectively use this form
> in our kernel code for parts that need to work on multiple
> platforms ?

This concept also works inside a kernel, driver or in the world. The
concept should then be limited to the module.

Erich
Received on Fri Jul 27 2012 - 07:44:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:29 UTC