DragonFly BSD
DragonFly submit List (threaded) for 2003-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Make usr.bin compile with gcc 3.3


From: Craig Dooley <cd5697@xxxxxxxxxx>
Date: Tue, 5 Aug 2003 23:02:06 -0400

Heres a patch to make usr.bin compile cleanly with gcc 3.3.  My eventual goal 
is to get buildworld working, but I think a lot of stuff in contrib will have 
to be updated.  One problem is gcc 3.3 cant compile gcc 2.95 :(  I have much 
of usr.sbin working also, and hopefully tomorrow can get that out.

-Craig
-- 
Craig Dooley						 cd5697@xxxxxxxxxx
Index: usr.bin/gensetdefs/gensetdefs.c
===================================================================
RCS file: /home/dcvs/src/usr.bin/gensetdefs/gensetdefs.c,v
retrieving revision 1.2
diff -u -r1.2 gensetdefs.c
--- usr.bin/gensetdefs/gensetdefs.c	17 Jun 2003 04:29:27 -0000	1.2
+++ usr.bin/gensetdefs/gensetdefs.c	5 Aug 2003 12:42:10 -0000
@@ -119,18 +119,16 @@
 		err(1, "setdef0.c");
 
 	fprintf(fp, "/* THIS FILE IS GENERATED, DO NOT EDIT. */\n\n");
-	fprintf(fp, "\
-#define DEFINE_SET(set, count)				\\\n\
-__asm__(\".section .set.\" #set \",\\\"aw\\\"\");	\\\n\
-__asm__(\".globl \" #set);			\\\n\
-__asm__(\".type \" #set \",@object\");		\\\n\
-__asm__(\".p2align %d\");				\\\n\
-__asm__(#set \":\");				\\\n\
-__asm__(\".%s \" #count);			\\\n\
-__asm__(\".previous\")\n\
+	fprintf(fp, "#define DEFINE_SET(set, count)				\\\n");
+	fprintf(fp, "__asm__(\".section .set.\" #set \",\\\"aw\\\"\");	\\\n");
+	fprintf(fp, "__asm__(\".globl \" #set);			\\\n");
+	fprintf(fp, "__asm__(\".type \" #set \",@object\");		\\\n");
+	fprintf(fp, "__asm__(\".p2align %d\");				\\\n", align);
+	fprintf(fp, "__asm__(#set \":\");				\\\n");
+	fprintf(fp, "__asm__(\".%s \" #count);			\\\n", ptrop);
+	fprintf(fp, "__asm__(\".previous\")\n");
 
-#include \"setdefs.h\"		/* Contains a `DEFINE_SET' for each set */\n\
-", align, ptrop);
+	fprintf(fp, "#include \"setdefs.h\"		/* Contains a `DEFINE_SET' for each set */\n");
 
 	fclose(fp);
 
@@ -139,14 +137,12 @@
 		err(1, "setdef0.c");
 
 	fprintf(fp, "/* THIS FILE IS GENERATED, DO NOT EDIT. */\n\n");
-	fprintf(fp, "\
-#define DEFINE_SET(set, count)				\\\n\
-__asm__(\".section .set.\" #set \",\\\"aw\\\"\");	\\\n\
-__asm__(\".%s 0\");			\\\n\
-__asm__(\".previous\")\n\
+	fprintf(fp, "#define DEFINE_SET(set, count)				\\\n");
+	fprintf(fp, "__asm__(\".section .set.\" #set \",\\\"aw\\\"\");	\\\n");
+	fprintf(fp, "__asm__(\".%s 0\");			\\\n", ptrop);
+	fprintf(fp, "__asm__(\".previous\")\n");
 
-#include \"setdefs.h\"		/* Contains a `DEFINE_SET' for each set */\n\
-", ptrop);
+	fprintf(fp, "#include \"setdefs.h\"		/* Contains a `DEFINE_SET' for each set */\n");
 
 	fclose(fp);
 
Index: usr.bin/lock/lock.c
===================================================================
RCS file: /home/dcvs/src/usr.bin/lock/lock.c,v
retrieving revision 1.2
diff -u -r1.2 lock.c
--- usr.bin/lock/lock.c	17 Jun 2003 04:29:28 -0000	1.2
+++ usr.bin/lock/lock.c	5 Aug 2003 12:43:50 -0000
@@ -61,7 +61,7 @@
 #include <string.h>
 #include <syslog.h>
 #include <unistd.h>
-#include <varargs.h>
+#include <stdarg.h>
 
 #define	TIMEOUT	15
 
Index: usr.bin/ncal/Makefile
===================================================================
RCS file: /home/dcvs/src/usr.bin/ncal/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- usr.bin/ncal/Makefile	17 Jun 2003 04:29:29 -0000	1.2
+++ usr.bin/ncal/Makefile	5 Aug 2003 12:47:37 -0000
@@ -3,7 +3,7 @@
 PROG= ncal
 SRCS= ncal.c
 
-CFLAGS+=	-Wall -Wmissing-prototypes -fstrict-prototypes -ansi -pedantic
+CFLAGS+=	-Wall -Wmissing-prototypes -ansi -pedantic
 
 DPADD+=		${LIBCALENDAR}
 LDADD+=		-lcalendar
Index: usr.bin/window/wwprintf.c
===================================================================
RCS file: /home/dcvs/src/usr.bin/window/wwprintf.c,v
retrieving revision 1.2
diff -u -r1.2 wwprintf.c
--- usr.bin/window/wwprintf.c	17 Jun 2003 04:29:34 -0000	1.2
+++ usr.bin/window/wwprintf.c	5 Aug 2003 12:55:09 -0000
@@ -39,18 +39,26 @@
  */
 
 #include "ww.h"
-#include <varargs.h>
+#include <stdarg.h>
 
 /*VARARGS2*/
+#if __STDC__
+wwprintf(struct ww *w, char *fmt, ...)
+#else
 wwprintf(w, fmt, va_alist)
-struct ww *w;
-char *fmt;
-va_dcl
+	struct ww *w;
+	char *fmt;
+	va_dcl
+#endif
 {
 	char buf[1024];
 	va_list ap;
 
+#if __STDC__
+	va_start(ap, fmt);
+#else
 	va_start(ap);
+#endif
 	/* buffer can overflow */
 	(void) wwwrite(w, buf, vsprintf(buf, fmt, ap));
 	va_end(ap);

Attachment: pgp00000.pgp
Description: signature



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]