ports/158270: cad/spice: cleanup some warning that CLANG considers fatal.
Pedro Giffuni
giffunip at tutopia.com
Sat Jun 25 01:20:05 UTC 2011
>Number: 158270
>Category: ports
>Synopsis: cad/spice: cleanup some warning that CLANG considers fatal.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Sat Jun 25 01:20:04 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Pedro Giffuni
>Release: 9.0-Current
>Organization:
>Environment:
FreeBSD mogwai.giffuni.net 9.0-CURRENT FreeBSD 9.0-CURRENT #6: Sat Apr 30 01:37:57 PDT 2011 root at build9x64.pcbsd.org:/usr/obj/pcbsd-build90/fbsd-source/9.0/sys/PCBSD amd64
>Description:
CLANG is very picky about "void main", which is barely a warning on gcc.
I think I got all of those and, while here, I cleaned up some header
includes.
>How-To-Repeat:
>Fix:
Patch attached
Patch attached with submission follows:
diff -ruN spice.orig/files/patch-src-lib-mfb-mfbcaps.c spice/files/patch-src-lib-mfb-mfbcaps.c
--- spice.orig/files/patch-src-lib-mfb-mfbcaps.c 2011-06-24 14:25:22.000000000 +0000
+++ spice/files/patch-src-lib-mfb-mfbcaps.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
---- src/lib/mfb/mfbcaps.c.orig Sat Oct 7 15:56:38 2006
-+++ src/lib/mfb/mfbcaps.c Sat Oct 7 15:57:51 2006
-@@ -43,9 +43,9 @@
-
- FILE *POpen();
- char *strcpy();
--char *MFBSkip();
-+static char *MFBSkip();
- char *MFBGetStr();
--char *MFBCapDecod();
-+static char *MFBCapDecod();
- int MFBGetNum();
- int MFBGetFlag();
- int MFBGetEnt();
diff -ruN spice.orig/files/patch-src_bin_help.c spice/files/patch-src_bin_help.c
--- spice.orig/files/patch-src_bin_help.c 1970-01-01 00:00:00.000000000 +0000
+++ spice/files/patch-src_bin_help.c 2011-06-24 19:14:44.000000000 +0000
@@ -0,0 +1,11 @@
+--- src/bin/help.c.orig 2011-06-24 19:12:52.000000000 +0000
++++ src/bin/help.c 2011-06-24 19:13:19.000000000 +0000
+@@ -46,7 +46,7 @@
+ char *hlp_filelist[] = { "spice", 0 };
+
+ /* ARGSUSED */
+-void
++int
+ main(ac, av)
+ int ac;
+ char **av;
diff -ruN spice.orig/files/patch-src_bin_main.c spice/files/patch-src_bin_main.c
--- spice.orig/files/patch-src_bin_main.c 1970-01-01 00:00:00.000000000 +0000
+++ spice/files/patch-src_bin_main.c 2011-06-24 16:55:29.000000000 +0000
@@ -0,0 +1,11 @@
+--- src/bin/main.c.orig 2011-06-24 16:53:54.000000000 +0000
++++ src/bin/main.c 2011-06-24 16:54:24.000000000 +0000
+@@ -183,7 +183,7 @@
+
+ char *hlp_filelist[] = { "spice", 0 };
+
+-void
++int
+ main(ac, av)
+ char **av;
+ {
diff -ruN spice.orig/files/patch-src_bin_procmod.c spice/files/patch-src_bin_procmod.c
--- spice.orig/files/patch-src_bin_procmod.c 1970-01-01 00:00:00.000000000 +0000
+++ spice/files/patch-src_bin_procmod.c 2011-06-24 16:10:20.000000000 +0000
@@ -0,0 +1,11 @@
+--- src/bin/proc2mod.c.orig 2011-06-24 16:07:41.000000000 +0000
++++ src/bin/proc2mod.c 2011-06-24 16:08:43.000000000 +0000
+@@ -51,7 +51,7 @@
+ char *dataline;
+
+
+-void
++int
+ main() {
+ char *typeline;
+ char *prname;
diff -ruN spice.orig/files/patch-src_bin_sconvert_c spice/files/patch-src_bin_sconvert_c
--- spice.orig/files/patch-src_bin_sconvert_c 2011-06-24 14:25:22.000000000 +0000
+++ spice/files/patch-src_bin_sconvert_c 2011-06-24 19:07:29.000000000 +0000
@@ -1,5 +1,14 @@
---- src/bin/sconvert.c.orig Mon Sep 14 21:30:41 1992
-+++ src/bin/sconvert.c Thu Jul 17 00:47:50 2003
+--- src/bin/sconvert.c.orig 1992-09-15 01:30:41.000000000 +0000
++++ src/bin/sconvert.c 2011-06-24 19:05:59.000000000 +0000
+@@ -36,7 +36,7 @@
+ static struct plot *oldread();
+ static char *fixdate();
+
+-void
++int
+ main(ac, av)
+ char **av;
+ {
@@ -80,19 +80,19 @@
case 1: printf("Input file: ");
diff -ruN spice.orig/files/patch-src_include_fteext.h spice/files/patch-src_include_fteext.h
--- spice.orig/files/patch-src_include_fteext.h 1970-01-01 00:00:00.000000000 +0000
+++ spice/files/patch-src_include_fteext.h 2011-06-24 16:22:24.000000000 +0000
@@ -0,0 +1,11 @@
+--- src/include/fteext.h.orig 2011-06-24 16:19:49.000000000 +0000
++++ src/include/fteext.h 2011-06-24 16:21:21.000000000 +0000
+@@ -419,7 +419,7 @@
+ extern SIGNAL_TYPE sigbus();
+ extern SIGNAL_TYPE sigsegv();
+ extern SIGNAL_TYPE sig_sys();
+-extern void main();
++extern int main();
+
+ /* spiceif.c & nutmegif.c */
+
diff -ruN spice.orig/files/patch-src_include_misc_h spice/files/patch-src_include_misc_h
--- spice.orig/files/patch-src_include_misc_h 2011-06-24 14:25:22.000000000 +0000
+++ spice/files/patch-src_include_misc_h 2011-06-24 16:39:39.000000000 +0000
@@ -1,16 +1,26 @@
---- src/include/misc.h.orig Sun Apr 25 16:37:48 1993
-+++ src/include/misc.h Mon Apr 3 23:04:51 2006
-@@ -86,8 +86,10 @@
+--- src/include/misc.h.orig 1993-04-25 21:37:48.000000000 +0000
++++ src/include/misc.h 2011-06-24 16:37:44.000000000 +0000
+@@ -86,9 +86,11 @@
extern char *realloc();
extern char *getenv();
extern int errno;
+#ifndef __FreeBSD__
extern char *sys_errlist[];
extern char *getenv();
-+#endif
extern char *getwd();
++#endif
extern int rand();
extern int srand();
+ extern int atoi();
+@@ -100,7 +102,7 @@
+ # endif
+
+ # ifdef HAS_GETCWD
+-extern char *getcwd( );
++#include <unistd.h>
+ # endif
+
+ # ifdef HAS_CLEARERR
@@ -154,7 +156,9 @@
#ifndef HAS_MEMAVL
diff -ruN spice.orig/files/patch-src_lib_cp_cshpar_c spice/files/patch-src_lib_cp_cshpar_c
--- spice.orig/files/patch-src_lib_cp_cshpar_c 2011-06-24 14:25:22.000000000 +0000
+++ spice/files/patch-src_lib_cp_cshpar_c 1970-01-01 00:00:00.000000000 +0000
@@ -1,10 +0,0 @@
---- src/lib/cp/cshpar.c.orig Mon Nov 12 02:26:08 2007
-+++ src/lib/cp/cshpar.c Mon Nov 12 02:30:46 2007
-@@ -6,6 +6,7 @@
- /*
- * The main entry point for cshpar.
- */
-+#include <unistd.h>
-
- #include "spice.h"
- #include "misc.h"
diff -ruN spice.orig/files/patch-src_lib_cp_unixcom.c spice/files/patch-src_lib_cp_unixcom.c
--- spice.orig/files/patch-src_lib_cp_unixcom.c 1970-01-01 00:00:00.000000000 +0000
+++ spice/files/patch-src_lib_cp_unixcom.c 2011-06-24 16:32:22.000000000 +0000
@@ -0,0 +1,10 @@
+--- src/lib/cp/unixcom.c.orig 2011-06-24 16:24:35.000000000 +0000
++++ src/lib/cp/unixcom.c 2011-06-24 16:30:47.000000000 +0000
+@@ -6,6 +6,7 @@
+ /*
+ * Routines to do execution of unix commands.
+ */
++#include <unistd.h>
+
+ #include "spice.h"
+ #include "cpdefs.h"
diff -ruN spice.orig/files/patch-src_lib_mfb_mfbcaps.c spice/files/patch-src_lib_mfb_mfbcaps.c
--- spice.orig/files/patch-src_lib_mfb_mfbcaps.c 1970-01-01 00:00:00.000000000 +0000
+++ spice/files/patch-src_lib_mfb_mfbcaps.c 2011-06-24 19:58:46.000000000 +0000
@@ -0,0 +1,22 @@
+--- src/lib/mfb/mfbcaps.c.orig 1991-04-01 22:32:50.000000000 +0000
++++ src/lib/mfb/mfbcaps.c 2011-06-24 19:53:27.000000000 +0000
+@@ -26,6 +26,7 @@
+ #include "spice.h"
+ #include "mfb.h"
+ #include <ctype.h>
++#include <string.h>
+ #include "suffix.h"
+
+
+@@ -43,9 +44,9 @@
+
+ FILE *POpen();
+ char *strcpy();
+-char *MFBSkip();
++static char *MFBSkip();
+ char *MFBGetStr();
+-char *MFBCapDecod();
++static char *MFBCapDecod();
+ int MFBGetNum();
+ int MFBGetFlag();
+ int MFBGetEnt();
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list