summaryrefslogtreecommitdiff
path: root/gen.c
diff options
context:
space:
mode:
authorVern Paxson <vern@ee.lbl.gov>1995-03-27 14:36:45 +0000
committerVern Paxson <vern@ee.lbl.gov>1995-03-27 14:36:45 +0000
commit23db8cf3cee2d936db60e7c275d82093b656b654 (patch)
tree8a101476ac3d89924595687361eec517483a572c /gen.c
parent7220b1e31077a70c20b604d2ff21c7103856dca0 (diff)
fixed lint problem with declaring yy_cp unnecessarily
Diffstat (limited to 'gen.c')
-rw-r--r--gen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gen.c b/gen.c
index a16a2b6..192b0dd 100644
--- a/gen.c
+++ b/gen.c
@@ -663,9 +663,12 @@ int worry_about_NULs;
void gen_NUL_trans()
{ /* NOTE - changes in here should be reflected in gen_next_match() */
+ /* Only generate a definition for "yy_cp" if we'll generate code
+ * that uses it. Otherwise lint and the like complain.
+ */
int need_backing_up = (num_backing_up > 0 && ! reject);
- if ( need_backing_up )
+ if ( need_backing_up && ! nultrans )
/* We'll need yy_cp lying around for the gen_backing_up(). */
indent_puts( "register char *yy_cp = yy_c_buf_p;" );