From owner-freebsd-current Sat Sep 7 20:55:24 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E1A537B400 for ; Sat, 7 Sep 2002 20:55:21 -0700 (PDT) Received: from dibbler.ne.client2.attbi.com (dibbler.ne.client2.attbi.com [24.61.41.247]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CFFD43E42 for ; Sat, 7 Sep 2002 20:55:15 -0700 (PDT) (envelope-from rodrigc@attbi.com) Received: from dibbler.ne.client2.attbi.com (localhost [127.0.0.1]) by dibbler.ne.client2.attbi.com (8.12.6/8.12.5) with ESMTP id g883t85q006941 for ; Sat, 7 Sep 2002 23:55:09 -0400 (EDT) (envelope-from rodrigc@dibbler.ne.client2.attbi.com) Received: (from rodrigc@localhost) by dibbler.ne.client2.attbi.com (8.12.6/8.12.6/Submit) id g883t8Tj006940 for freebsd-current@freebsd.org; Sat, 7 Sep 2002 23:55:08 -0400 (EDT) Date: Sat, 7 Sep 2002 23:55:08 -0400 From: Craig Rodrigues To: freebsd-current@freebsd.org Subject: [PATCH] C++ fix for flex Message-ID: <20020907235508.A6911@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, As I am fixing some of the C++ ports for GCC 3.2, I found a problem with lex. The following patch is required for lex to generate code which can compile with GCC 3.2. It applies to /usr/src/usr.bin/lex --- flex.skl.orig Sat Sep 7 23:44:38 2002 +++ flex.skl Sat Sep 7 23:45:06 2002 @@ -26,7 +26,8 @@ #include %+ -class istream; +#include +using namespace std; %* #include For Standard C++, you cannot forward declare istream as: class istream; because in Standard C++, istream is a typedef for a template: typedef basic_istream istream; The correct fix is to include . Under gcc 2.95, forward declares istream as "class istream;" and under gcc 3.2, forward declares istream as the typedef. The "using namespace std;" is required because in gcc 3.2, istream is in the std namespace. In gcc 2.95, this line will be benign. -- Craig Rodrigues http://www.gis.net/~craigr rodrigc@attbi.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message