From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 31 Aug 2001 04:28:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 31 Aug 2001 04:27:57 -0400 Received: from shed.alex.org.uk ([195.224.53.219]:19613 "HELO shed.alex.org.uk") by vger.kernel.org with SMTP id ; Fri, 31 Aug 2001 04:27:42 -0400 Date: Fri, 31 Aug 2001 09:27:53 +0100 From: Alex Bligh - linux-kernel Reply-To: Alex Bligh - linux-kernel To: Jonathan Lundell , ptb@it.uc3m.es, gordo@pincoya.com Cc: linux kernel , Alex Bligh - linux-kernel Subject: Re: [IDEA+RFC] Possible solution for min()/max() war Message-ID: <821911999.999250073@[169.254.198.40]> In-Reply-To: In-Reply-To: X-Mailer: Mulberry/2.1.0b3 (Win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org >># define __MIN(x,y) ({\ >> typeof(x) _x = x; \ >> typeof(y) _y = y; \ >> _x < _y ? _x : _y ; \ >> }) > > How about typeof(__MIN(u, s)), given unsigned u, int s? As this would expand to typeof({typeof(u) _u=u .... ? _u : _s;}) I am willing to bet it wouldn't even compile with either version of min, so it doesn't matter. -- Alex Bligh