From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 2 15:59:49 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4BE5816A407 for ; Sun, 2 Jul 2006 15:59:49 +0000 (UTC) (envelope-from randyhyde@earthlink.net) Received: from elasmtp-galgo.atl.sa.earthlink.net (elasmtp-galgo.atl.sa.earthlink.net [209.86.89.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBFF643D46 for ; Sun, 2 Jul 2006 15:59:48 +0000 (GMT) (envelope-from randyhyde@earthlink.net) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=BeIK97Mxi0a4rFwr75bz0W1y7DhyKkoxZVW1ZWkUsT/ZOy8D24QlvY1F1fftsn21; h=Received:Message-ID:From:To:References:Subject:Date:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Priority:X-MSMail-Priority:X-Mailer:X-MimeOLE:X-ELNK-Trace:X-Originating-IP; Received: from [24.180.58.59] (helo=pentiv) by elasmtp-galgo.atl.sa.earthlink.net with asmtp (Exim 4.34) id 1Fx4MO-0003Lb-0X for freebsd-hackers@freebsd.org; Sun, 02 Jul 2006 11:59:48 -0400 Message-ID: <001b01c69df0$973850c0$6302a8c0@pentiv> From: "Randall Hyde" To: References: <200605271102.19799.hselasky@c2i.net><200606302029.28563.hselasky@c2i.net><20060630203226.GG734@turion.vk2pj.dyndns.org><200607011044.54872.hselasky@c2i.net> <20060701123444.GD8447@turion.vk2pj.dyndns.org> Date: Sun, 2 Jul 2006 09:00:07 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-ELNK-Trace: eba5e0c9192a36dcd6dd28457998182d7e972de0d01da940de51b7939e7063835168e21e54c50403350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 24.180.58.59 Subject: Re: contiguous memory allocation problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jul 2006 15:59:49 -0000 ----- Original Message ----- From: "Peter Jeremy" To: "Randall Hyde" Sent: Saturday, July 01, 2006 11:10 PM Subject: Re: FLEX, was Re: Return value of malloc(0) The following compiles without error: %{ typedef int YYSTYPE; typedef int YYLTYPE; /* ** Allow for a recursive version of Bison parser. */ #undef YY_DECL #define YY_DECL int yylex( YYSTYPE *yylval, YYLTYPE *yylloc) %} %% . ECHO; %% I'll accept that you are having a problem getting HLA to build. No-one else is reporting problems. If you want assistance from other people then you are going to need to help by either providing a test case to reproduce the failure you are seeing or you are going to need to provide the pre-processed context where the error occurs. <<<<<<<<<<<<<<<<<<<<<<< Uh, is the above *not* the test case you are asking for? Does this particular code snippet compile for you? If so, then I've definitely got some configuration problems with GCC on my machine. BTW, if I haven't made myself clear, the problem with the code above is a GCC error, not a FLEX error. That is, FLEX happily produces the yy.lex.c output file, GCC under FreeBSD rejects the source code it produces. Yet that *same exact* source code compiles just fine under Linux with GCC, Windows with Borland C++, and Windows with VC++. Creating a recursive lexer is a documented feature of FLEX. Indeed, I used the example present in the FLEX documentation to pull this off. And I've been using this code for about eight years on Windows and about four years on Linux. Perhaps FreeBSD types have never tried to create a recursive parser/lexer and haven't had to deal with this issue, but as you can see from the code snippet above, this really has nothing to do with HLA, per se, other than the fact that it uses a recursive lexer/parser. And the fact remains, the code compiles just fine under Windows and Linux. The compilation uses a documented feature of FLEX. There *is* a problem with the implementation of GCC under FreeBSD (or header files under FreeBSD). It's not specific to HLA. And I can't imagine how to give you a better test case than the code above. Cheers, Randy Hyde