Hi,
In lex the return value of scanopt_destroy() is never used.
This function is a wrapper for free(), and free() has no value to return.
- Michael
Index: scanopt.c
===================================================================
RCS file: /cvs/src/usr.bin/lex/scanopt.c,v
retrieving revision 1.5
diff -u -p -u -r1.5 scanopt.c
--- scanopt.c 11 Dec 2015 00:08:43 -0000 1.5
+++ scanopt.c 31 May 2017 02:23:18 -0000
@@ -857,7 +857,7 @@ int scanopt (svoid, arg, optindex)
}
-int scanopt_destroy (svoid)
+void scanopt_destroy (svoid)
scanopt_t *svoid;
{
struct _scanopt_t *s;
@@ -867,5 +867,4 @@ int scanopt_destroy (svoid)
free(s->aux);
free (s);
}
- return 0;
}
Index: scanopt.h
===================================================================
RCS file: /cvs/src/usr.bin/lex/scanopt.h,v
retrieving revision 1.2
diff -u -p -u -r1.2 scanopt.h
--- scanopt.h 19 Nov 2015 22:16:43 -0000 1.2
+++ scanopt.h 31 May 2017 02:23:18 -0000
@@ -90,9 +90,8 @@ extern "C" {
scanopt_t *scanopt_init PROTO ((const optspec_t * options,
int argc, char **argv, int flags));
-/* Frees memory used by scanner.
- * Always returns 0. */
- int scanopt_destroy PROTO ((scanopt_t * scanner));
+/* Frees memory used by scanner. */
+ void scanopt_destroy PROTO ((scanopt_t * scanner));
#ifndef NO_SCANOPT_USAGE
/* Prints a usage message based on contents of optlist.