NetBSD Problem Report #8258
Received: (qmail 8727 invoked from network); 24 Aug 1999 01:00:16 -0000
Message-Id: <199908232121.OAA02132@nooksack.ldc.cs.wwu.edu>
Date: Mon, 23 Aug 1999 14:21:46 -0700 (PDT)
From: nick@nthcliff.demon.co.uk
Reply-To: nick@nthcliff.demon.co.uk
To: gnats-bugs@gnats.netbsd.org
Subject: lex doesn't produce correct output for C++
X-Send-Pr-Version: www-1.0
>Number: 8258
>Category: bin
>Synopsis: lex doesn't produce correct output for C++
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: simonb
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 23 18:05:04 +0000 1999
>Closed-Date: Wed Mar 15 22:54:17 +0000 2000
>Last-Modified: Wed Mar 15 22:55:34 +0000 2000
>Originator: Nick Hudson
>Release: 1.4.1
>Organization:
none
>Environment:
NetBSD nthcliff 1.4.1 NetBSD 1.4.1 (NTHCLIFF) #0: Thu Jul 29 19:41:02 BST 1999 root@nthcliff:/usr/src-1.4.1/sys/arch/i386/compile/NTHCLIFF i386
>Description:
See summary
>How-To-Repeat:
Use lex with -+ option and compile resulting code and see warnings
$ lex -+ tokenizer.l
$ g++ lex.yy.cc
lex.yy.cc: In method `struct yy_buffer_state * yyFlexLexer::yy_create_buffer(class istream *, int)':
lex.yy.cc:1759: warning: implicit declaration of function `int yy_flex_alloc(...)'
lex.yy.cc: In method `void yyFlexLexer::yy_delete_buffer(struct yy_buffer_state *)':
lex.yy.cc:1789: warning: implicit declaration of function `int yy_flex_free(...)'
>Fix:
Apply the following patch to flex.skl. This brings the files into line with flex 2.5.4
$ diff -u flex.skl.orig flex.skl
--- flex.skl.orig Tue Jan 19 12:13:11 1999
+++ flex.skl Mon Aug 23 22:10:23 1999
@@ -254,6 +254,10 @@
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, yy_size_t len ));
%*
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
@@ -275,11 +279,6 @@
%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
%- Standard (non-C++) definition
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-#ifndef YY_USES_REJECT
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-#endif
-static void yy_flex_free YY_PROTO(( void * ));
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed
State-Changed-By: simonb
State-Changed-When: Wed Mar 15 02:21:27 PST 2000
State-Changed-Why:
Hubert Feyrer is testing a "make build" with a very similar fix
now. Waiting for feedback from him.
Responsible-Changed-From-To: bin-bug-people->simonb
Responsible-Changed-By: simonb
Responsible-Changed-When: Wed Mar 15 02:21:27 PST 2000
Responsible-Changed-Why:
I independantly game up with an almost identical fix for this PR
in response to a problem reported on the tech-pkg list. Nick has
since referred me to this PR.
State-Changed-From-To: analyzed->closed
State-Changed-By: simonb
State-Changed-When: Wed Mar 15 14:54:17 PST 2000
State-Changed-Why:
Feedback is positive from all parties
.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.