diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | awkgram.c | 7 | ||||
-rw-r--r-- | awkgram.y | 7 |
3 files changed, 13 insertions, 6 deletions
@@ -1,3 +1,8 @@ +2013-04-14 Arnold D. Robbins <arnold@skeeve.com> + + * awkgram.y (check_funcs): Fix logic of test for called but + not defined warning. Thanks to Scott Deifik for the bug report. + 2013-04-02 Arnold D. Robbins <arnold@skeeve.com> * profile.c (print_lib_list): Send final newline to prof_fp @@ -6901,17 +6901,18 @@ check_funcs() for (i = 0; i < HASHSIZE; i++) { for (fp = ftable[i]; fp != NULL; fp = fp->next) { - if (fp->defined == 0 && ! fp->extension) { #ifdef REALLYMEAN - /* making this the default breaks old code. sigh. */ + /* making this the default breaks old code. sigh. */ + if (fp->defined == 0 && ! fp->extension) { error( _("function `%s' called but never defined"), fp->name); errcount++; + } #else + if (do_lint && fp->defined == 0 && ! fp->extension) lintwarn( _("function `%s' called but never defined"), fp->name); #endif - } if (do_lint && fp->used == 0 && ! fp->extension) { lintwarn(_("function `%s' defined but never called directly"), @@ -4353,17 +4353,18 @@ check_funcs() for (i = 0; i < HASHSIZE; i++) { for (fp = ftable[i]; fp != NULL; fp = fp->next) { - if (fp->defined == 0 && ! fp->extension) { #ifdef REALLYMEAN - /* making this the default breaks old code. sigh. */ + /* making this the default breaks old code. sigh. */ + if (fp->defined == 0 && ! fp->extension) { error( _("function `%s' called but never defined"), fp->name); errcount++; + } #else + if (do_lint && fp->defined == 0 && ! fp->extension) lintwarn( _("function `%s' called but never defined"), fp->name); #endif - } if (do_lint && fp->used == 0 && ! fp->extension) { lintwarn(_("function `%s' defined but never called directly"), |