From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47046 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeAEy-00067e-7z for qemu-devel@nongnu.org; Sat, 15 Jan 2011 12:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PeAAu-0005A9-6U for qemu-devel@nongnu.org; Sat, 15 Jan 2011 12:44:29 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:53140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PeAAt-00059s-Rf for qemu-devel@nongnu.org; Sat, 15 Jan 2011 12:44:28 -0500 Message-ID: <4D31DCF7.2060909@mail.berlios.de> Date: Sat, 15 Jan 2011 18:44:23 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] RFC: mass comment conversion from C99 to C89 References: <1295112015.2795.6.camel@Quad> In-Reply-To: <1295112015.2795.6.camel@Quad> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Laurent Vivier , qemu-devel Am 15.01.2011 18:20, schrieb Laurent Vivier: > Le samedi 15 janvier 2011 à 16:02 +0000, Blue Swirl a écrit : >> With the sed script below (my first I think), I'm able to convert most > > nice script. Did you try awk ? > >> files in QEMU from C99 comment style to C89. When successive line with >> C99 comments are converted, the comments are merged. Two files > > [ This remembers me the port of gstreamer to AIX using xlc, which was > C89 only... ] > >> (hw/rtl8139.c and microblaze-dis.c) still fail. >> >> Is this a good idea? > > I think line like: > > //#define DEBUG > > should be changed to > > #if 0 > #define DEBUG > #endif > > as it is not really a comment but a flag. The pattern //~ is also some kind of flag. I must admit that I introduced some of these lines because my favorite editor (SciTE) allows to toggle these lines to code. Laurent's solution would be fine for those, too. It's also possible to replace all #if 0 by #if 1 to test compilation of debug code. Is there an urgent need to fix all C99 comments? I'd appreciate to see blanks at line endings or tabs fixed, too. At least fixing the blanks is much easier than fixing C99 comments. Regards, Stefan