From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 29 05:40:32 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 B7DBB16A4D2 for ; Thu, 29 Jun 2006 05:40:32 +0000 (UTC) (envelope-from randyhyde@earthlink.net) Received: from smtpauth04.mail.atl.earthlink.net (smtpauth04.mail.atl.earthlink.net [209.86.89.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 988BC43D8E for ; Thu, 29 Jun 2006 05:40:31 +0000 (GMT) (envelope-from randyhyde@earthlink.net) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=CEBHw06E6NKnvUKeVxcmH6TRBX7Cz7udSRvucDcQeyScgnUQax+AvRlnc1ee2+B+; 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 smtpauth04.mail.atl.earthlink.net with asmtp (Exim 4.34) id 1FvpGQ-0003vf-Sy for freebsd-hackers@freebsd.org; Thu, 29 Jun 2006 01:40:31 -0400 Message-ID: <004201c69b3e$915bada0$6302a8c0@pentiv> From: "Randall Hyde" To: References: <20060628181045.GA54915@curry.mchp.siemens.de> <44wtb12fu0.fsf@be-well.ilk.org> <004301c69b1d$164b5370$6302a8c0@pentiv> <20060629021028.GA31866@troutmask.apl.washington.edu> Date: Wed, 28 Jun 2006 22:40:45 -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: eba5e0c9192a36dcd6dd28457998182d7e972de0d01da9402ec6622fbbc387b0f81b70576779b111350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 24.180.58.59 Subject: FLEX, was Re: Return value of malloc(0) 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: Thu, 29 Jun 2006 05:40:32 -0000 > > > > Without seeing the code or the actual error message, I'm > guessing the answer is 42. Perhaps, some detail might > be appropriate. I seriously doubt seeing the code will do much good. Here's the offending line: YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); This is from static int yy_get_next_buffer() Which is part of the canned code that comes with FLEX. Compiles just fine under Linux. Linux has a slightly newer version of GCC, but I've been compiling this code on Windows (Borland and VC++) as well as Linux for years without a problem (i.e., older versions of GCC). BTW, if anyone is intrested in the full FLEX source, it's part of the HLA (High Level Assembler) source package found here: http://webster.cs.ucr.edu/AsmTools/HLA/HLAv1.84/hlasrc.zip I compiled the FLEX code with the command line: flex -8 -i hla.flx This works fine, then I compile the GCC output with gcc -DfreeBSD -c -o lex.yy.o lex.yy.c and it stops with "syntax error before numeric constant". As this code is in part of the FLEX-supplied C code, I would think that this problem would be independent of my particular flex code. BTW, I've tried using both the FLEX I use on Linux under BSD as well as the BSD-supplied version. I've even taken the FLEX output from freeBSD and compiled it under Linux (it compiles successfully. I'm using GCC 3.3.5 under Linux, 3.4.4 under BSD. Any known problems with 3.4.4 that would cause this? cheers, Randy Hyde