Procházet zdrojové kódy

Accomodate ANSI C compiler better

ceriel před 32 roky
rodič
revize
2ac0b945f5
2 změnil soubory, kde provedl 25 přidání a 1 odebrání
  1. 15 1
      fast/driver/afcc.1
  2. 10 0
      fast/driver/driver.c

+ 15 - 1
fast/driver/afcc.1

@@ -1,6 +1,6 @@
 .TH AFCC 1
 .SH NAME
-afcc \- fast ACK compatible ANSI C compiler
+afcc \- fast ACK compatible C compiler
 .SH SYNOPSIS
 .B afcc
 [
@@ -10,6 +10,12 @@ afcc \- fast ACK compatible ANSI C compiler
 .B \-v
 ]
 [
+.B \-ansi
+]
+[
+.B \-R
+]
+[
 .B \-vn
 ]
 [ \fB\-D\fIname\fR ]
@@ -77,6 +83,14 @@ You can specify a name for the executable by using the
 option.
 .SH OPTIONS
 .LP
+.IP \fB\-ansi\fP
+Use the ANSI C compiler instead of the K&R one. This flag must be first,
+and must also be used when linking through 
+.I afcc
+or
+.I ack.
+.IP \fB\-R\fP
+test for more compatibility with Kernighan & Ritchie C [1].
 .IP \fB\-c\fP
 .br
 Suppress the loading phase of the compilation, and force an object module to

+ 10 - 0
fast/driver/driver.c

@@ -225,6 +225,12 @@ lang_opt(str)
 	char *str;
 {
 	switch(str[1]) {
+	case 'R':
+		if (! ansi_c) {
+			append(&COMP_FLAGS, str);
+			return 1;
+		}
+		break;
 	case '-':	/* debug options */
 		append(&COMP_FLAGS, str);
 		return 1;
@@ -236,6 +242,10 @@ lang_opt(str)
 		}
 		break;
 	case 'w':	/* disable warnings */
+		if (! ansi_c) {
+			append(&COMP_FLAGS, str);
+			return 1;
+		}
 		if (str[2]) {
 			str[1] = '-';
 			append(&COMP_FLAGS, &str[1]);