postgres.git / summary / log / commit / refs

commit    a15cb0652fff820e15212f38b88c7198542c5015
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Tue Sep 08 04:25:25 2009 +0000
First released in: 9.0.0, 7.4.27, 8.0.23, 8.1.19, 8.2.15, 8.3.9, 8.4.2

    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.


src/interfaces/ecpg/preproc/extern.h | 5 ++--- src/interfaces/ecpg/preproc/preproc.y | 8 ++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/interfaces/ecpg/preproc/extern.h b/src/interfaces/ecpg/preproc/extern.h index c9097c87eec..8bb943c4731 100644 --- a/src/interfaces/ecpg/preproc/extern.h +++ b/src/interfaces/ecpg/preproc/extern.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.70 2007/11/15 21:14:45 momjian Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.70.2.1 2009/09/08 04:25:25 tgl Exp $ */ #ifndef _ECPG_PREPROC_EXTERN_H #define _ECPG_PREPROC_EXTERN_H @@ -38,8 +38,7 @@ extern char *yytext, #ifdef YYDEBUG extern int yydebug; #endif -extern int yylineno, - yyleng; +extern int yylineno; extern FILE *yyin, *yyout; extern char *output_filename; diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index ef63a7a03c3..49540aa742d 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.359.2.6 2008/10/10 12:20:06 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.359.2.7 2009/09/08 04:25:25 tgl Exp $ */ /* Copyright comment */ %{ @@ -173,11 +173,7 @@ make3_str(char *str1, char *str2, char *str3) static char * make_name(void) { - char * name = (char *)mm_alloc(yyleng + 1); - - strncpy(name, yytext, yyleng); - name[yyleng] = '\0'; - return(name); + return mm_strdup(yytext); } static char * [parent: dfd5282bf340]