With new gcc and -Wshadow, src/bin/ed/re.c shows this warning: cc -Wshadow -c re.c re.c: In function `get_compiled_pattern': re.c:44: warning: declaration of `exp' shadows a global declaration <built-in>:0: warning: shadowed declaration is here It seems local variable exp is conflicted with exp(3) declaration. I don't know what name should be used... Index: re.c =================================================================== RCS file: /home/ncvs/src/bin/ed/re.c,v retrieving revision 1.19 diff -u -r1.19 re.c --- re.c 30 Jun 2002 05:13:53 -0000 1.19 +++ re.c 14 Jul 2003 23:42:41 -0000 _at__at_ -41,7 +41,7 _at__at_ pattern_t * get_compiled_pattern(void) { - static pattern_t *exp = NULL; + static pattern_t *expr = NULL; static char error[1024]; char *exps; _at__at_ -52,27 +52,27 _at__at_ errmsg = "invalid pattern delimiter"; return NULL; } else if (delimiter == '\n' || *++ibufp == '\n' || *ibufp == delimiter) { - if (!exp) + if (!expr) errmsg = "no previous pattern"; - return exp; + return expr; } else if ((exps = extract_pattern(delimiter)) == NULL) return NULL; /* buffer alloc'd && not reserved */ - if (exp && !patlock) - regfree(exp); - else if ((exp = (pattern_t *) malloc(sizeof(pattern_t))) == NULL) { + if (expr && !patlock) + regfree(expr); + else if ((expr = (pattern_t *) malloc(sizeof(pattern_t))) == NULL) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "out of memory"; return NULL; } patlock = 0; - if ((n = regcomp(exp, exps, 0))) { - regerror(n, exp, error, sizeof error); + if ((n = regcomp(expr, exps, 0))) { + regerror(n, expr, error, sizeof error); errmsg = error; - free(exp); - return exp = NULL; + free(expr); + return expr = NULL; } - return exp; + return expr; } -- Jun Kuriyama <kuriyama_at_imgsrc.co.jp> // IMG SRC, Inc. <kuriyama_at_FreeBSD.org> // FreeBSD ProjectReceived on Mon Jul 14 2003 - 16:33:42 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:15 UTC