From owner-freebsd-questions Tue May 7 5:44:32 2002 Delivered-To: freebsd-questions@freebsd.org Received: from uk2.kanda-systems.net (uk2.kanda-systems.net [193.195.117.202]) by hub.freebsd.org (Postfix) with ESMTP id 804E137B404 for ; Tue, 7 May 2002 05:44:25 -0700 (PDT) Received: from localhost.kanda-systems.net (localhost.kanda-systems.net [127.0.0.1]) by uk2.kanda-systems.net (Postfix) with ESMTP id 82BFD3C1E8; Tue, 7 May 2002 14:56:55 +0100 (BST) Date: Tue, 7 May 2002 14:56:55 +0100 (BST) From: jason+freebsd@kanda.com X-X-Sender: jason@uk2.kanda-systems.net Reply-To: jason+freebsd@kanda.com To: shubhamr Cc: "questions@FreeBSD.ORG" Subject: Re: coments in freebsd In-Reply-To: <3CD7C423.3CAD457D@malkauns.nsc.com> Message-ID: <20020507145015.R67080-100000@uk2.kanda-systems.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 7 May 2002, shubhamr wrote: > I have numerous files .c files not written acording to the ANSI c > style.They have comented using // instead of regular /* > */.convention.How do I compile them? Hi, I take it that you are wanting to use these files with a compiler that doesn't support // syntax. Check with the compiler documentation first, sometimes they have a switch to enable c++ style comments. Alternatively you could use the sed command (available within FreeBSD) to convert all the // comments into /* comments. To convert a file: cat cfile.c sed "s/\(.*\)\/\/\(.*\)/\1 \/*\2 \*\//" > cfile.c.fixed Then: mv cfile.c.filed cfile.c I suggest you make backups of your c files before beginning this operation. If you have more than a few c files you'll probably want to script this operation. Regards Jason ==================================================================== Jason Taylor. Kanda Systems Ltd. Tel: +44/0 1970 621030 Systems Manager. Unit 17 Glanyrafon Fax: +44/0 1970 621040 jason@kanda.com. Enterprise Park. Mobile: +44/0 7976 926918 http://www.kanda.com. Ceredigion, UK http://shop.kanda.com ==================================================================== To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message