aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--awkgram.c27
-rw-r--r--awkgram.y27
3 files changed, 30 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index a7dee7d0..7906bede 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (check_funcs): Remove the REALLYMEAN ifdef and
+ simplify the lint checking code for function defined but not
+ called or called but not defined.
+
2017-10-13 Arnold D. Robbins <arnold@skeeve.com>
Assume a more C99 environment:
diff --git a/awkgram.c b/awkgram.c
index 0c52841e..aee0e2f0 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -7357,22 +7357,19 @@ check_funcs()
for (i = 0; i < HASHSIZE; i++) {
for (fp = ftable[i]; fp != NULL; fp = fp->next) {
-#ifdef REALLYMEAN
- /* 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->extension) {
+ /*
+ * Making this not a lint check and
+ * incrementing * errcount breaks old code.
+ * Sigh.
+ */
+ if (fp->defined == 0)
+ lintwarn(_("function `%s' called but never defined"),
+ fp->name);
- if (do_lint && fp->used == 0 && ! fp->extension) {
- lintwarn(_("function `%s' defined but never called directly"),
- fp->name);
+ if (fp->used == 0)
+ lintwarn(_("function `%s' defined but never called directly"),
+ fp->name);
}
}
}
diff --git a/awkgram.y b/awkgram.y
index f8b3035d..178c3077 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -4937,22 +4937,19 @@ check_funcs()
for (i = 0; i < HASHSIZE; i++) {
for (fp = ftable[i]; fp != NULL; fp = fp->next) {
-#ifdef REALLYMEAN
- /* 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->extension) {
+ /*
+ * Making this not a lint check and
+ * incrementing * errcount breaks old code.
+ * Sigh.
+ */
+ if (fp->defined == 0)
+ lintwarn(_("function `%s' called but never defined"),
+ fp->name);
- if (do_lint && fp->used == 0 && ! fp->extension) {
- lintwarn(_("function `%s' defined but never called directly"),
- fp->name);
+ if (fp->used == 0)
+ lintwarn(_("function `%s' defined but never called directly"),
+ fp->name);
}
}
}