Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4d3456e

Browse files
committed
Remove outside-the-scanner references to "yyleng".
It seems the flex developers have decided to change yyleng from int to size_t. This has already happened in the latest release of OS X, and will start happening elsewhere once the next release of flex appears. Rather than trying to divine how it's declared in any particular build, let's just remove the one existing not-very-necessary external usage. Back-patch to all supported branches; not so much because users in the field are likely to care about building old branches with cutting-edge flex, as to keep OSX-based buildfarm members from having problems with old branches.
1 parent 9f0e84a commit 4d3456e

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/interfaces/ecpg/preproc/ecpg.header

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.8 2009/08/07 10:51:20 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.9 2009/09/08 04:25:00 tgl Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -184,11 +184,7 @@ make3_str(char *str1, char *str2, char *str3)
184184
static char *
185185
make_name(void)
186186
{
187-
char * name = (char *)mm_alloc(yyleng + 1);
188-
189-
strncpy(name, yytext, yyleng);
190-
name[yyleng] = '\0';
191-
return(name);
187+
return mm_strdup(yytext);
192188
}
193189

194190
static char *
@@ -220,7 +216,7 @@ create_questionmarks(char *name, bool array)
220216
for (; count > 0; count --)
221217
{
222218
sprintf(pacounter_buffer, "$%d", pacounter++);
223-
result = cat_str(3, result, strdup(pacounter_buffer), make_str(" , "));
219+
result = cat_str(3, result, mm_strdup(pacounter_buffer), make_str(" , "));
224220
}
225221

226222
/* removed the trailing " ," */

src/interfaces/ecpg/preproc/extern.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.74 2009/07/14 20:24:10 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.75 2009/09/08 04:25:00 tgl Exp $ */
22

33
#ifndef _ECPG_PREPROC_EXTERN_H
44
#define _ECPG_PREPROC_EXTERN_H
@@ -39,8 +39,7 @@ extern char *yytext,
3939
#ifdef YYDEBUG
4040
extern int yydebug;
4141
#endif
42-
extern int yylineno,
43-
yyleng;
42+
extern int yylineno;
4443
extern FILE *yyin,
4544
*yyout;
4645
extern char *output_filename;

0 commit comments

Comments
 (0)