From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16961 invoked by alias); 13 Aug 2004 22:02:02 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 16951 invoked from network); 13 Aug 2004 22:02:01 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sourceware.org with SMTP; 13 Aug 2004 22:02:01 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i7DM20Zt009040 for ; Sat, 14 Aug 2004 00:02:00 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i7DM20mT012170 for ; Sat, 14 Aug 2004 00:02:00 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i7DM1x5k012167; Sat, 14 Aug 2004 00:02:00 +0200 (CEST) Date: Fri, 13 Aug 2004 22:02:00 -0000 Message-Id: <200408132202.i7DM1x5k012167@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb@sources.redhat.com Subject: Preprocessor symbol style X-SW-Source: 2004-08/txt/msg00209.txt.bz2 IIRC this has been discussed before, hopefully people forgive me raising the issue again. Currently in GDB we use the following style for preprocessor stuff: #ifdef HAVE_FOO_H #include #else #ifdef HAVE_BAR_H #include #ifndef HAVE_FOOBAR #define FOOBAR FOO(BAR) #endif #endif #endif I think this style has a serious problem; it's rather difficult to see how the #if's and #endif's balance. Personally I've been bitten by this more than once. Many GNU projects (GCC, glibc, autoconf, coreutils) use a somewhat different style: #ifdef HAVE_FOO_H # include #else # ifdef HAVE_BAR_H # include # ifndef HAVE_FOOBAR # define FOOBAR FOO(BAR) # endif # endif #endif This makes it much easier to see how the #if's and #endif's balance. Can we please adopt the second style for GDB? We can convert things incrementally, or if we want to do it all at once, I'll volunteer to provide the mamoth patch. Mark