Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S275084AbTHLHLQ (ORCPT ); Tue, 12 Aug 2003 03:11:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S275092AbTHLHLQ (ORCPT ); Tue, 12 Aug 2003 03:11:16 -0400 Received: from pcp01184054pcs.strl301.mi.comcast.net ([68.60.186.73]:32988 "EHLO michonline.com") by vger.kernel.org with ESMTP id S275084AbTHLHLN (ORCPT ); Tue, 12 Aug 2003 03:11:13 -0400 Date: Tue, 12 Aug 2003 03:11:12 -0400 From: Ryan Anderson To: linux-kernel@vger.kernel.org Subject: Re: [Dri-devel] Re: [PATCH] CodingStyle fixes for drm_agpsupport Message-ID: <20030812071112.GQ24278@michonline.com> Mail-Followup-To: linux-kernel@vger.kernel.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1035 Lines: 31 On Mon, Aug 11, 2003 at 01:21:22PM -0700, Sottek, Matthew J wrote: > 2) There are some very real ways that bracketless code will > get broken. Either someone adds a line that didn't notice the > lack of brackets or, someone accidentally uses a multi-line > macro. > > i.e. > if(foo) > DEBUG_PRINT("Foo!\n"); > > works great for 100 years until someone recodes the DEBUG_PRINT > macro to be 2 lines. The Linux kernel often has plain looking > functions or variables that end up being macros (and may only > expand to multi-line on some platforms) which could easily get > you into such a situation. #define DEBUG_PRINT(x) do { printk((x)); printk((x)); } while (0) I believe your example is, oh, the #1 reason for this style of macro. -- Ryan Anderson sometimes Pug Majere - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/