From owner-freebsd-current@FreeBSD.ORG Fri Jul 27 09:44:53 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14F35106566C for ; Fri, 27 Jul 2012 09:44:53 +0000 (UTC) (envelope-from erichfreebsdlist@ovitrap.com) Received: from alogreentechnologies.com (alogreentechnologies.com [67.212.224.110]) by mx1.freebsd.org (Postfix) with ESMTP id BF4BC8FC15 for ; Fri, 27 Jul 2012 09:44:52 +0000 (UTC) Received: from AMD620.ovitrap.com ([49.128.188.2]) (authenticated bits=0) by alogreentechnologies.com (8.13.1/8.13.1) with ESMTP id q6R9ij3N026053; Fri, 27 Jul 2012 03:44:48 -0600 Date: Fri, 27 Jul 2012 16:47:15 +0700 From: Erich Dollansky To: Luigi Rizzo Message-ID: <20120727164715.51ba740d@AMD620.ovitrap.com> In-Reply-To: <20120727093824.GB56662@onelab2.iet.unipi.it> References: <20120727093824.GB56662@onelab2.iet.unipi.it> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: current@freebsd.org Subject: Re: (void)foo or __unused foo ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 09:44:53 -0000 Hi, On Fri, 27 Jul 2012 11:38:24 +0200 Luigi Rizzo 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