pkgsrc/editors/ex/patches/patch-ex__version_c
dholland a3dfc1076f Fix legacy C. Pass -Wall -W -Wmissing-declarations -Wwrite-strings on
gcc45.

   - avoid implicit int, declare void functions void
   - return values from non-void functions
   - put most external declarations properly in header files
   - use some static and const
   - fix up a big mess with function pointer casting
   - use standard includes, don't provide own decls of standard functions
   - use types matching libc when providing own malloc, printf, and putchar
   - use <ctype.h> functions correctly
   - silence assorted compiler warnings
   - fix some bugs exposed by compiler warnings
   - don't intentionally exercise signed overflow
   - remove some unused items
   - add patch comments to other patch (patch-aa)

As this includes several fixes and removes some undefined behavior on
a commonly reachable code path, bump PKGREVISION.
2012-12-28 03:03:08 +00:00

21 lines
495 B
Text

$NetBSD: patch-ex__version_c,v 1.1 2012/12/28 03:03:09 dholland Exp $
- declare void functions void
- use const for string constants
--- ex_version.c~ 2004-01-03 14:11:39.000000000 +0000
+++ ex_version.c
@@ -74,10 +74,11 @@
*/
#include "ex.h"
+#include "ex_proto.h"
-static char *versionstring = "@(#)Version 3.7, 6/7/85 (gritter) 1/3/04";
+static const char *versionstring = "@(#)Version 3.7, 6/7/85 (gritter) 1/3/04";
-int
+void
printver()
{
printf("%s%s%s", versionstring + 4,