Index: driver/cfa.cc
===================================================================
--- driver/cfa.cc	(revision 4615ac81401b8a87620dad09deac63435bd06109)
+++ driver/cfa.cc	(revision 8c63bb42271126b7d84fc31b4b09965990322777)
@@ -10,6 +10,6 @@
 // Created On       : Tue Aug 20 13:44:49 2002
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Feb 10 08:28:09 2019
-// Update Count     : 281
+// Last Modified On : Fri Aug  9 18:51:44 2019
+// Update Count     : 309
 //
 
@@ -20,4 +20,5 @@
 #include <string>										// STL version
 #include <string.h>										// strcmp
+#include <algorithm>									// find
 
 #include <sys/types.h>
@@ -26,4 +27,5 @@
 #include "Common/SemanticError.h"
 #include "config.h"										// configure info
+
 
 using std::cerr;
@@ -40,27 +42,17 @@
 } // prefix
 
-enum { NumSuffixes = 2 };
-const string suffixes[NumSuffixes] = { "cfa", "hfa", };
-
-bool suffix( string arg, const char * args[], int & nargs ) {
+bool suffix( string arg ) {
+	enum { NumSuffixes = 3 };
+	static const string suffixes[NumSuffixes] = { "cfa", "hfa", "ifa" };
 	//std::cerr << arg << std::endl;
 	size_t dot = arg.find_last_of( "." );
 	//std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl;
 	if ( dot == string::npos ) return false;
-	string sx = arg.substr( dot + 1 );
-	for ( int i = 0; i < NumSuffixes; i += 1 ) {
-		if ( sx == suffixes[i] ) {
-			args[nargs] = "-x";
-			nargs += 1;
-			args[nargs] = "c";
-			nargs += 1;
-			return true;
-		} // if
-	} // for
-	return false;
+	const string * end = suffixes + NumSuffixes;
+	return std::find( suffixes, end, arg.substr( dot + 1 ) ) != end;
 } // suffix
 
 
-void shuffle( const char *args[], int S, int E, int N ) {
+void shuffle( const char * args[], int S, int E, int N ) {
 	// S & E index 1 passed the end so adjust with -1
 	#ifdef __DEBUG_H__
@@ -75,5 +67,5 @@
 } // shuffle
 
-static inline bool dirExists(const string & path) {
+static inline bool dirExists( const string & path ) {
     struct stat info;
     if(stat( path.c_str(), &info ) != 0)
@@ -88,5 +80,5 @@
 #define str(s) #s
 
-int main( int argc, char *argv[] ) {
+int main( int argc, char * argv[] ) {
 	string Version( CFA_VERSION_LONG );					// current version number from CONFIG
 	string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) );
@@ -104,11 +96,12 @@
 	string compiler_name;								// name of C compiler
 
+	bool suffixp = false;								// -x flag
 	bool nonoptarg = false;								// indicates non-option argument specified
 	bool link = true;									// linking as well as compiling
 	bool verbose = false;								// -v flag
-	bool quiet = false;								// -quiet flag
-	bool debug = true;								// -debug flag
-	bool nolib = false;								// -nolib flag
-	bool help = false;								// -help flag
+	bool quiet = false;									// -quiet flag
+	bool debug = true;									// -debug flag
+	bool nolib = false;									// -nolib flag
+	bool help = false;									// -help flag
 	bool CFA_flag = false;								// -CFA flag
 	bool cpp_flag = false;								// -E or -M flag, preprocessor only
@@ -116,6 +109,6 @@
 	bool noincstd_flag = false;							// -no-include-stdhdr= flag
 	bool debugging __attribute(( unused )) = false;		// -g flag
-	bool m32 = false;                                    // -m32 flag
-	bool m64 = false;                                    // -m64 flag
+	bool m32 = false;									// -m32 flag
+	bool m64 = false;									// -m64 flag
 	bool intree = false;
 
@@ -207,4 +200,18 @@
 				args[nargs] = ( *new string( string("-D__CFA_FLAG__=") + arg ) ).c_str(); // add the argument for cfa-cpp
 				nargs += 1;
+			} else if ( prefix( arg, "-x" ) ) {			// file suffix ?
+				string lang;
+				args[nargs] = argv[i];					// pass the argument along
+				nargs += 1;
+				if ( arg.length() == 2 ) {				// separate argument ?
+					i += 1;
+					if ( i == argc ) continue;			// next argument available ?
+					lang = argv[i];
+					args[nargs] = argv[i];				// pass the argument along
+					nargs += 1;
+				} else {
+					lang = arg.substr( 2 );
+				} // if
+				suffixp = lang != "none";
 			} else if ( prefix( arg, "-W" ) ) {			// check before next tests
 				if ( arg == "-Werror" || arg == "-Wall" ) {
@@ -283,8 +290,14 @@
 			} // if
 		} else {
-			bool cfa = suffix( arg, args, nargs );		// check suffix
+			bool cfa = suffix( arg );					// check suffix
+			if ( ! suffixp && cfa ) {					// no explicit suffix and cfa suffix ?
+				args[nargs] = "-x";
+				nargs += 1;
+				args[nargs] = "c";
+				nargs += 1;
+			} // if
 			args[nargs] = argv[i];						// concatenate file
 			nargs += 1;
-			if ( cfa ) {
+			if ( ! suffixp && cfa ) {					// no explicit suffix and cfa suffix ?
 				args[nargs] = "-x";
 				nargs += 1;
@@ -295,9 +308,4 @@
 		} // if
 	} // for
-
-    args[nargs] = "-x";									// turn off language
-    nargs += 1;
-    args[nargs] = "none";
-    nargs += 1;
 
 	#ifdef __x86_64__
