Index: driver/Makefile
===================================================================
--- driver/Makefile	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
+++ driver/Makefile	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
@@ -0,0 +1,31 @@
+###
+### This file is part of the Cforall project
+###
+### $Id: Makefile.in,v 1.5 2005/08/26 19:16:54 rcbilson Exp $
+###
+
+CXX=g++
+CXXFLAGS=-g -Wall -I.. #-Wno-unused
+CP=gcc -E
+INSTALL=/usr/bin/install -c
+
+SRCS:=cfa.cc cc1.cc
+OBJECTS:=$(SRCS:.cc=.o)
+DEPS:=$(SRCS:.cc=.d)
+
+all: cfa cc1
+
+cfa: cfa.o
+	$(CXX) $< -o $@
+
+cc1 : cc1.o
+	$(CXX) $< -o $@
+
+install: cfa cc1
+	$(INSTALL) -d /u/pabuhr/software/cfa/cfa-cc/bin
+	$(INSTALL) -d /u/pabuhr/software/cfa/cfa-cc/lib
+	$(INSTALL) cc1 /u/pabuhr/software/cfa/cfa-cc/lib
+	$(INSTALL) cfa /u/pabuhr/software/cfa/cfa-cc/bin
+
+clean:
+	rm -f cfa cc1 $(OBJECTS) $(DEPS) core
Index: driver/Makefile.am
===================================================================
--- driver/Makefile.am	(revision a9049dd64205261c925e9c9e1b7b6ef7b1da8073)
+++ 	(revision )
@@ -1,45 +1,0 @@
-######################## -*- Mode: Makefile-Automake -*- ######################
-##
-## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-##
-## The contents of this file are covered under the licence agreement in the
-## file "LICENCE" distributed with Cforall.
-##
-## Makefile.am --
-##
-## Author           : Peter A. Buhr
-## Created On       : Sun May 31 08:49:31 2015
-## Last Modified By : Peter A. Buhr
-## Last Modified On : Thu Aug  2 12:18:25 2018
-## Update Count     : 14
-###############################################################################
-
-AUTOMAKE_OPTIONS = foreign    # do not require all the GNU file names
-ACLOCAL_AMFLAGS  = -I automake
-
-# applies to both programs
-AM_CXXFLAGS = @HOST_FLAGS@ -Wall -Wextra -Werror=return-type -O2 -g -std=c++17 -I${abs_top_srcdir}/src -I${abs_top_srcdir}/src/include
-
-# don't install cfa directly
-noinst_PROGRAMS = cfa
-
-# use
-install-exec-hook:
-	@test -z "$(CFA_BINDIR)" || $(MKDIR_P) "$(CFA_BINDIR)"
-	@echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) cfa '$(CFA_BINDIR)/$(CFA_NAME)'"; \
-	chmod u+w $(CFA_BINDIR);\
-	$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) cfa $(CFA_BINDIR)/$(CFA_NAME) || exit $$?
-
-uninstall-hook:
-	@echo " ( cd '$(CFA_BINDIR)' && rm -f $(CFA_NAME) )"; \
-	cd "$(CFA_BINDIR)" && rm -f $(CFA_NAME)
-
-cfa_SOURCES = cfa.cc
-
-# put into lib for now
-cc1libdir = ${CFA_LIBDIR}
-cc1lib_PROGRAMS = as cc1
-as_SOURCES = as.cc
-cc1_SOURCES = cc1.cc
-
-MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS}
Index: driver/Makefile.in
===================================================================
--- driver/Makefile.in	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
+++ driver/Makefile.in	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
@@ -0,0 +1,31 @@
+###
+### This file is part of the Cforall project
+###
+### $Id: Makefile.in,v 1.5 2005/08/26 19:16:54 rcbilson Exp $
+###
+
+CXX=@CXX@
+CXXFLAGS=-g -Wall -I.. #-Wno-unused
+CP=@CPP@
+INSTALL=@INSTALL@
+
+SRCS:=cfa.cc cc1.cc
+OBJECTS:=$(SRCS:.cc=.o)
+DEPS:=$(SRCS:.cc=.d)
+
+all: cfa cc1
+
+cfa: cfa.o
+	$(CXX) $< -o $@
+
+cc1 : cc1.o
+	$(CXX) $< -o $@
+
+install: cfa cc1
+	$(INSTALL) -d @CFA_BINDIR@
+	$(INSTALL) -d @CFA_LIBDIR@
+	$(INSTALL) cc1 @CFA_LIBDIR@
+	$(INSTALL) cfa @CFA_BINDIR@
+
+clean:
+	rm -f cfa cc1 $(OBJECTS) $(DEPS) core
Index: driver/as.cc
===================================================================
--- driver/as.cc	(revision a9049dd64205261c925e9c9e1b7b6ef7b1da8073)
+++ 	(revision )
@@ -1,99 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// as.c -- map assembler file, scan for debug information, then language code, and skip N lines forward to code. If
-//         code is C dialect, possibly expand file by one character, and replace with Cforall language code.
-//
-// Author           : Peter A. Buhr
-// Created On       : Wed Aug  1 10:49:42 2018
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Oct 24 20:45:06 2023
-// Update Count     : 159
-//
-
-#include <cstdio>										// perror
-#include <cstdlib>										// exit
-#include <fcntl.h>										// open
-#include <cstring>										// strstr, memmove
-#include <unistd.h>										// ftruncate,execvp
-#include <sys/stat.h>									// fstat
-#include <sys/mman.h>									// mmap
-
-//#define __DEBUG_H__
-
-int main( const int argc, const char * argv[] ) {
-	#ifdef __DEBUG_H__
-	for ( int i = 0; i < argc; i += 1 ) {
-		fprintf( stderr, "%s\n", argv[i] );
-	} // for
-	#endif // __DEBUG_H__
-
-	int fd = open( argv[argc - 1], O_RDWR );
-	if ( fd < 0 ) { perror( "open" ); exit( EXIT_FAILURE ); };
-
-	struct stat mystat = {};
-	if ( fstat( fd, &mystat ) ) { perror( "fstat" ); exit( EXIT_FAILURE ); };
-	off_t size = mystat.st_size;
-
-	if ( size ) {										// cannot map 0 sized file
-		char * start = (char *)mmap( NULL, size + 2, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
-		if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); };
-
-		char * dcursor;
-		if ( (dcursor = strstr( start, ".Ldebug_info0:" ) ) ) { // debug information ?
-			// fprintf( stderr, "found .Ldebug_info0:\n" );
-#if defined( __i386 ) || defined( __x86_64 )
-			if ( char * cursor = strstr( dcursor, ".long\t.LASF" ) ) { // language code ?
-				// fprintf( stderr, ".long\t.LASF\n" );
-#elif defined( __aarch64__ )
-			if ( char * cursor = strstr( dcursor, ".4byte\t.LASF" ) ) { // language code ?
-				// fprintf( stderr, ".4byte\t.LASF\n" );
-#else
-	#error unsupported architecture
-#endif
-				for ( int i = 0; i < 2; i += 1 ) {		// move N (magic) lines forward
-					cursor = strstr( cursor, "\n" ) + 1;
-				} // for
-				cursor -= 2;							// backup over "d\n", where d is a hex digit
-				// From elfcpp/dwarf.h in the binutils source tree.
-				// DW_LANG_C89 = 0x1, DW_LANG_C = 0x2, DW_LANG_C99 = 0xc, DW_LANG_C11 = 0x1d
-				if ( *(cursor - 2) == '0' && *(cursor - 1) == 'x' &&
-					 (*cursor == 'c' || *cursor == '1' || *cursor == '2') ) { // C99/C89/C
-					// fprintf( stderr, "language code C99/C89/C %c\n", *cursor );
-					// Expand file by one byte to hold 2 character Cforall language code.
-					if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); };
-					memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right
-				} else if ( *(cursor - 3) == '0' && *(cursor - 2) == 'x' && *(cursor - 1) == '1' && *cursor == 'd' ) { // C11
-					// fprintf( stderr, "language code C11 %c\n", *cursor );
-				} else {
-					for ( int i = 0; i < 6; i += 1 ) {	// move N (magic) lines forward
-						cursor = strstr( cursor, "\n" ) + 1;
-					} // for
-					fprintf( stderr, "*** ERROR *** Invalid C language code found in assembler file: %s\n"
-							 "Assembler debug information:\n%.*s",
-							 argv[argc - 1], (int)(cursor - dcursor), dcursor );
-					exit( EXIT_FAILURE );
-				} // if
-
-				*(cursor - 1) = '2';					// replace C89/C/C99/C11 language code with CFA code
-				*cursor = '5';
-			} // if
-		} // if
-
-		if ( munmap( start, size + 2 ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk
-	} // if
-
-	argv[0] = "as";
-	execvp( argv[0], (char * const *)argv );			// should not return
-	perror( "CFA Translator error: cpp level, execvp" );
-	exit( EXIT_FAILURE );								// tell gcc not to go any further
-} // main
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "g++ -Wall -Wextra as.c -o as" //
-// End: //
Index: driver/cc1.cc
===================================================================
--- driver/cc1.cc	(revision a9049dd64205261c925e9c9e1b7b6ef7b1da8073)
+++ driver/cc1.cc	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
@@ -1,29 +1,40 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// cc1.cc --
-//
-// Author           : Peter A. Buhr
+//                              -*- Mode: C++ -*-
+// 
+// CForall Version 1.0, Copyright (C) Peter A. Buhr 2005
+// 
+// cc1.cc -- 
+// 
+// Author           : Richard C. Bilson
 // Created On       : Fri Aug 26 14:23:51 2005
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Sep 25 11:07:22 2023
-// Update Count     : 427
+// Last Modified On : Fri Oct 17 18:02:37 2014
+// Update Count     : 4
 //
+// This  library is free  software; you  can redistribute  it and/or  modify it
+// under the terms of the GNU Lesser General Public License as published by the
+// Free Software  Foundation; either  version 2.1 of  the License, or  (at your
+// option) any later version.
+// 
+// This library is distributed in the  hope that it will be useful, but WITHOUT
+// ANY  WARRANTY;  without even  the  implied  warranty  of MERCHANTABILITY  or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+// for more details.
+// 
+// You should  have received a  copy of the  GNU Lesser General  Public License
+// along  with this library.
+// 
+
 
 #include <iostream>
+using std::cerr;
+using std::endl;
 #include <string>
-#include <algorithm>									// find
-#include <cstdio>										// stderr, stdout, perror, fprintf
-#include <cstdlib>										// getenv, exit, mkstemp
-using namespace std;
-#include <unistd.h>										// execvp, fork, unlink
-#include <sys/wait.h>									// wait
-#include <fcntl.h>										// creat
-
-
-#include "config.h"										// configure info
+using std::string;
+#include <cstdio>					// stderr, stdout, perror, fprintf
+#include <cstdlib>					// getenv, exit, mkstemp
+#include <unistd.h>					// execvp, fork, unlink
+#include <sys/wait.h>					// wait
+
+#include "config.h"					// configure info
 
 
@@ -31,570 +42,434 @@
 
 
-static string compiler_path( CFA_BACKEND_CC );			// C compiler path/name
-static bool CFA_flag = false;							// -CFA flag
-static bool save_temps = false;							// -save-temps flag
-static string o_file;
-static string bprefix;
-static string lang;										// -x flag
-
-
-static bool prefix( const string & arg, const string & pre ) {
-	return arg.substr( 0, pre.size() ) == pre;
+string compiler_name( GCC_PATH );                       // path/name of C compiler
+
+string D__GCC_BPREFIX__( "-D__GCC_BPREFIX__=" );
+
+
+bool prefix( string arg, string pre ) {
+    return arg.substr( 0, pre.size() ) == pre;
 } // prefix
 
-static void suffix( const string & arg, const char * args[], int & nargs ) {
-	enum { NumSuffixes = 3 };
-	static const string suffixes[NumSuffixes] = { "cfa", "hfa", "ifa" };
-
-	size_t dot = arg.find_last_of( "." );
-	if ( dot == string::npos ) return;
-	const string * end = suffixes + NumSuffixes;
-	if ( find( suffixes, end, arg.substr( dot + 1 ) ) != end ) {
-		args[nargs++] = "-x";
-		args[nargs++] = "c";
-	} // if
-} // suffix
-
-
-static string __CFA_FLAGPREFIX__( "__CFA_FLAG" );		// "__CFA_FLAG__=" suffix
-
-static void checkEnv1() {								// stage 1
-	extern char ** environ;
-
-	for ( int i = 0; environ[i]; i += 1 ) {
-		string arg( environ[i] );
-		#ifdef __DEBUG_H__
-		cerr << "env arg:\"" << arg << "\"" << endl;
-		#endif // __DEBUG_H__
-
-		if ( prefix( arg, __CFA_FLAGPREFIX__ ) ) {
-			string val( arg.substr( arg.find_first_of( "=" ) + 1 ) );
-			if ( prefix( val, "-compiler=" ) ) {
-				compiler_path = val.substr( 10 );
-			} else if ( prefix( val, "-x=" ) ) {
-				lang = val.substr( 3 );
-			} // if
+
+void checkEnv( const char *args[], int &nargs ) {
+    char *value;
+
+    value = getenv( "__COMPILER__" );
+    if ( value != NULL ) {
+	compiler_name = value;
+#ifdef __DEBUG_H__
+	cerr << "env arg:\"" << compiler_name << "\"" << endl;
+#endif // __DEBUG_H__
+    } // if
+
+    value = getenv( "__GCC_MACHINE__" );
+    if ( value != NULL ) {
+	args[nargs] = ( *new string( value ) ).c_str(); // pass the argument along
+#ifdef __DEBUG_H__
+	cerr << "env arg:\"" << args[nargs] << "\"" << endl;
+#endif // __DEBUG_H__
+	nargs += 1;
+    } // if
+
+    value = getenv( "__GCC_VERSION__" );
+    if ( value != NULL ) {
+	args[nargs] = ( *new string( value ) ).c_str(); // pass the argument along
+#ifdef __DEBUG_H__
+	cerr << "env arg:\"" << args[nargs] << "\"" << endl;
+#endif // __DEBUG_H__
+	nargs += 1;
+    } // if
+} // checkEnv
+
+
+void Stage1( const int argc, const char * const argv[] ) {
+    int code;
+    int i;
+
+    string arg;
+    string bprefix;
+
+    const char *cpp_in = NULL;
+    const char *cpp_out = NULL;
+
+    bool CFA_flag = false;
+    bool cpp_flag = false;
+    const char *o_name = NULL;
+
+    const char *args[argc + 100];			// leave space for 100 additional cpp command line values
+    int nargs = 1;					// number of arguments in args list; 0 => command name
+    const char *uargs[20];				// leave space for 20 additional cfa-cpp command line values
+    int nuargs = 1;					// 0 => command name
+
+    // process all the arguments
+
+    checkEnv( args, nargs );				// arguments passed via environment variables
+
+    for ( i = 1; i < argc; i += 1 ) {
+#ifdef __DEBUG_H__
+	cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	arg = argv[i];
+#ifdef __DEBUG_H__
+	cerr << "arg:\"" << arg << "\"" << endl;
+#endif // __DEBUG_H__
+	if ( prefix( arg, "-" ) ) {
+	    // strip g++ flags that are inappropriate or cause duplicates in subsequent passes
+
+	    if ( arg == "-quiet" ) {
+	    } else if ( arg == "-imultilib" || arg == "-imultiarch" ) {
+		i += 1;					// and the argument
+	    } else if ( prefix( arg, "-A" ) ) {
+	    } else if ( prefix( arg, "-D__GNU" ) ) {
+	    //********
+	    // GCC 5.6.0 SEPARATED THE -D FROM THE ARGUMENT!
+	    //********
+	    } else if ( arg == "-D" && prefix( argv[i + 1], "__GNU" ) ) {
+		i += 1;					// and the argument
+
+	    // strip cfa flags controlling cpp step
+
+	    } else if ( arg == "-D__CFA__" ) {
+		CFA_flag = true;
+	    } else if ( arg == "-D" && string( argv[i + 1] ) == "__CFA__" ) {
+		i += 1;					// and the argument
+		CFA_flag = true;
+	    } else if ( arg == "-D__CPP__" ) {
+		cpp_flag = true;
+	    } else if ( arg == "-D" && string( argv[i + 1] ) == "__CPP__" ) {
+		i += 1;					// and the argument
+		cpp_flag = true;
+	    } else if ( prefix( arg, D__GCC_BPREFIX__ ) ) {
+		bprefix = arg.substr( D__GCC_BPREFIX__.size() );
+	    } else if ( arg == "-D" && prefix( argv[i + 1], "__GCC_BPREFIX__=" ) ) {
+		bprefix = string( argv[i + 1] ).substr( D__GCC_BPREFIX__.size() - 2 );
+		i += 1;					// and the argument
+
+	    // all other flags
+
+	    } else if ( arg == "-o" ) {
+	        i += 1;
+	        o_name = argv[i];
+	    } else {
+		args[nargs] = argv[i];			// pass the flag along
+		nargs += 1;
+		// CPP flags with an argument
+		if ( arg == "-D" || arg == "-I" || arg == "-MF" || arg == "-MT" || arg == "-MQ" ||
+		     arg == "-include" || arg == "-imacros" || arg == "-idirafter" || arg == "-iprefix" ||
+		     arg == "-iwithprefix" || arg == "-iwithprefixbefore" || arg == "-isystem" || arg == "-isysroot" ) {
+		    i += 1;
+		    args[nargs] = argv[i];		// pass the argument along
+		    nargs += 1;
+#ifdef __DEBUG_H__
+		    cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+		} else if ( arg == "-MD" || arg == "-MMD" ) {
+		    args[nargs] = "-MF";		// insert before file
+		    nargs += 1;
+		    i += 1;
+		    args[nargs] = argv[i];		// pass the argument along
+		    nargs += 1;
+#ifdef __DEBUG_H__
+		    cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
 		} // if
-	} // for
-} // checkEnv1
-
-
-static void checkEnv2( const char * args[], int & nargs ) { // stage 2
-	extern char ** environ;
-
-	for ( int i = 0; environ[i]; i += 1 ) {
-		string arg( environ[i] );
-		#ifdef __DEBUG_H__
-		cerr << "env arg:\"" << arg << "\"" << endl;
-		#endif // __DEBUG_H__
-
-		if ( prefix( arg, __CFA_FLAGPREFIX__ ) ) {
-			string val( arg.substr( arg.find_first_of( "=" ) + 1 ) );
-			if ( prefix( val, "-compiler=" ) ) {
-				compiler_path = val.substr( 10 );
-			} else if ( val == "-CFA" ) {
-				CFA_flag = true;
-			} else if ( val == "-save-temps" || val == "--save-temps" ) {
-				save_temps = true;
-			} else if ( prefix( val, "-o=" ) ) {		// output file for -CFA
-				o_file = val.substr( 3 );
-			} else if ( prefix( val, "-B=" ) ) {		// location of cfa-cpp
-				bprefix = val.substr( 3 );
-			} else if ( prefix( val, "-x=" ) ) {		// ignore
-			} else {									// normal flag for cfa-cpp
-				args[nargs++] = ( *new string( arg.substr( arg.find_first_of( "=" ) + 1 ) ) ).c_str();
-			} // if
-		} // if
-	} // for
-} // checkEnv2
-
-#define CFA_SUFFIX ".ifa"
-
-static char tmpname[] = P_tmpdir "/CFAXXXXXX" CFA_SUFFIX;
-static int tmpfilefd = -1;
-static bool startrm = false;
-
-static void rmtmpfile() {
-	if ( tmpfilefd == -1 ) return;						// RACE, file created ?
-
-	startrm = true;										// RACE with C-c C-c
-	if ( unlink( tmpname ) == -1 ) {					// remove tmpname
-		perror ( "CC1 Translator error: failed, unlink" );
-		exit( EXIT_FAILURE );
-	} // if
-	tmpfilefd = -1;										// mark removed
-} // rmtmpfile
-
-
-static void sigTermHandler( int ) {						// C-c C-c
-	if ( startrm ) return;								// return and let rmtmpfile finish, and then program finishes
-
-	if ( tmpfilefd != -1 ) {							// RACE, file created ?
-		rmtmpfile();									// remove tmpname
-	} // if
-	exit( EXIT_FAILURE );								// terminate
-} // sigTermHandler
-
-
-static void Stage1( const int argc, const char * const argv[] ) {
-	int code;
-	string arg;
-
-	const char * cpp_in = nullptr;
-	const char * cpp_out = nullptr;
-
-	bool cpp_flag = false;
-	bool o_flag = false;
-
-	const char * args[argc + 100];						// leave space for 100 additional cpp command line values
-	int nargs = 1;										// number of arguments in args list; 0 => command name
-
-	#ifdef __DEBUG_H__
-	cerr << "#########" << endl << "Stage1 " << string( 100, '#' ) << endl << "#########" << endl;
-	#endif // __DEBUG_H__
-	checkEnv1();										// arguments passed via environment variables
-	#ifdef __DEBUG_H__
-	cerr << string( 100, '*' ) << endl;
-	for ( int i = 1; i < argc; i += 1 ) {
-		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
-	} // for
-	cerr << string( 100, '*' ) << endl;
-	#endif // __DEBUG_H__
-
-	// process all the arguments
-
-	for ( int i = 1; i < argc; i += 1 ) {
-		arg = argv[i];
-		if ( prefix( arg, "-" ) ) {
-			// strip g++ flags that are inappropriate or cause duplicates in subsequent passes
-
-			if ( arg == "-quiet" ) {
-			} else if ( arg == "-imultilib" || arg == "-imultiarch" ) {
-				i += 1;									// and argument
-			} else if ( prefix( arg, "-A" ) ) {
-			} else if ( prefix( arg, "-D__GNU" ) ) {
-				//********
-				// GCC 5.6.0 SEPARATED THE -D FROM THE ARGUMENT!
-				//********
-			} else if ( arg == "-D" && prefix( argv[i + 1], "__GNU" ) ) {
-				i += 1;									// and argument
-
-				// strip flags controlling cpp step
-
-			} else if ( arg == "-D__CPP__" ) {
-				cpp_flag = true;
-			} else if ( arg == "-D" && string( argv[i + 1] ) == "__CPP__" ) {
-				i += 1;									// and argument
-				cpp_flag = true;
-
-				// all other flags
-
-			} else if ( arg == "-o" ) {
-				i += 1;
-				o_flag = true;
-				cpp_out = argv[i];
-			} else {
-				args[nargs++] = argv[i];				// pass flag along
-				// CPP flags with an argument
-				if ( arg == "-D" || arg == "-U" || arg == "-I" || arg == "-MF" || arg == "-MT" || arg == "-MQ" ||
-					 arg == "-include" || arg == "-imacros" || arg == "-idirafter" || arg == "-iprefix" ||
-					 arg == "-iwithprefix" || arg == "-iwithprefixbefore" || arg == "-isystem" || arg == "-isysroot" ||
-					 arg == "-dumpbase-ext" || arg == "-dumpbase"
-					) {
-					i += 1;
-					args[nargs++] = argv[i];			// pass argument along
-					#ifdef __DEBUG_H__
-					cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
-					#endif // __DEBUG_H__
-				} else if ( arg == "-MD" || arg == "-MMD" ) {
-					// gcc frontend generates the dependency file-name after the -MD/-MMD flag, but it is necessary to
-					// prefix that file name with -MF.
-					args[nargs++] = "-MF";				// insert before file
-					i += 1;
-					args[nargs++] = argv[i];			// pass argument along
-					#ifdef __DEBUG_H__
-					cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
-					#endif // __DEBUG_H__
-				} // if
-			} // if
-		} else {										// obtain input and possibly output files
-			if ( cpp_in == nullptr ) {
-				cpp_in = argv[i];
-				#ifdef __DEBUG_H__
-				cerr << "cpp_in:\"" << cpp_in << "\"" << endl;
-				#endif // __DEBUG_H__
-			} else if ( cpp_out == nullptr ) {
-				cpp_out = argv[i];
-				#ifdef __DEBUG_H__
-				cerr << "cpp_out:\"" << cpp_out << "\""<< endl;
-				#endif // __DEBUG_H__
-			} else {
-				cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
-				exit( EXIT_FAILURE );
-			} // if
-		} // if
-	} // for
-
-	#ifdef __DEBUG_H__
-	cerr << "args:";
-	for ( int i = 1; i < nargs; i += 1 ) {
-		cerr << " " << args[i];
-	} // for
-	if ( cpp_in != nullptr ) cerr << " " << cpp_in;
-	if ( cpp_out != nullptr ) cerr << " " << cpp_out;
-	cerr << endl;
-	#endif // __DEBUG_H__
-
-	if ( cpp_in == nullptr ) {
+	    } // if
+	} else {					// obtain input and possibly output files
+	    if ( cpp_in == NULL ) {
+		cpp_in = argv[i];
+#ifdef __DEBUG_H__
+		cerr << "cpp_in:\"" << cpp_in << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( cpp_out == NULL ) {
+		cpp_out = argv[i];
+#ifdef __DEBUG_H__
+		cerr << "cpp_out:\"" << cpp_out << "\""<< endl;
+#endif // __DEBUG_H__
+	    } else {
 		cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
 		exit( EXIT_FAILURE );
+	    } // if
 	} // if
-
-	if ( cpp_flag ) {
-		// The -E flag is specified on the cfa command so only run the preprocessor and output is written to standard
-		// output or -o. The call to cfa has a -E so it does not have to be added to the argument list.
-
-		args[0] = compiler_path.c_str();
-		if ( lang.size() == 0 ) {
-			suffix( cpp_in, args, nargs );				// check suffix
-		} else {
-			args[nargs++] = "-x";
-			args[nargs++] = ( *new string( lang ) ).c_str();
+    } // for
+
+#ifdef __DEBUG_H__
+    cerr << "args:";
+    for ( i = 1; i < nargs; i += 1 ) {
+	cerr << " " << args[i];
+    } // for
+    if ( cpp_in != NULL ) cerr << " " << cpp_in;
+    if ( cpp_out != NULL ) cerr << " " << cpp_out;
+    cerr << endl;
+#endif // __DEBUG_H__
+
+    if ( cpp_in == NULL ) {
+	cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
+	exit( EXIT_FAILURE );
+    } // if
+
+    if ( cpp_flag ) {
+	// The -E flag is specified on the cfa command so only run the preprocessor and output is written to standard
+	// output or -o. The call to cfa has a -E so it does not have to be added to the argument list.
+
+	args[0] = compiler_name.c_str();
+	args[nargs] = cpp_in;
+	nargs += 1;
+	if ( o_name != NULL ) {				// location for output
+	    args[nargs] = "-o";
+	    nargs += 1;
+	    args[nargs] = o_name;
+	    nargs += 1;
+	} // if
+	args[nargs] = NULL;				// terminate argument list
+
+#ifdef __DEBUG_H__
+	cerr << "nargs: " << nargs << endl;
+	for ( i = 0; args[i] != NULL; i += 1 ) {
+	    cerr << args[i] << " ";
+	} // for
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	execvp( args[0], (char *const *)args );		// should not return
+	perror( "CFA Translator error: cpp level, execvp" );
+	exit( EXIT_FAILURE );
+    } // if
+
+    // Create a temporary file to store output of the C preprocessor.
+
+    char tmpname[] = P_tmpdir "/CFAXXXXXX";
+    int tmpfile = mkstemp( tmpname );
+    if ( tmpfile == -1 ) {
+	perror( "CFA Translator error: cpp level, mkstemp" );
+	exit( EXIT_FAILURE );
+    } // if
+
+#ifdef __DEBUG_H__
+    cerr << "tmpname:" << tmpname << " tmpfile:" << tmpfile << endl;
+#endif // __DEBUG_H__
+
+    // Run the C preprocessor and save the output in tmpfile.
+
+    if ( fork() == 0 ) {				// child process ?
+	// -o xxx.ii cannot be used to write the output file from cpp because no output file is created if cpp detects
+	// an error (e.g., cannot find include file). Whereas, output is always generated, even when there is an error,
+	// when cpp writes to stdout. Hence, stdout is redirected into the temporary file.
+	if ( freopen( tmpname, "w", stdout ) == NULL ) { // redirect stdout to tmpname
+	    perror( "CFA Translator error: cpp level, freopen" );
+	    exit( EXIT_FAILURE );
+	} // if
+
+	args[0] = compiler_name.c_str();
+	args[nargs] = cpp_in;				// input to cpp
+	nargs += 1;
+	args[nargs] = NULL;				// terminate argument list
+
+#ifdef __DEBUG_H__
+	cerr << "cpp nargs: " << nargs << endl;
+	for ( i = 0; args[i] != NULL; i += 1 ) {
+	    cerr << args[i] << " ";
+	} // for
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	execvp( args[0], (char *const *)args );		// should not return
+	perror( "CFA Translator error: cpp level, execvp" );
+	exit( EXIT_FAILURE );
+    } // if
+
+    wait( &code );					// wait for child to finish
+
+#ifdef __DEBUG_H__
+    cerr << "return code from cpp:" << WEXITSTATUS(code) << endl;
+#endif // __DEBUG_H__
+
+    if ( WIFSIGNALED(code) != 0 ) {			// child failed ?
+	unlink( tmpname );				// remove tmpname
+	cerr << "CFA Translator error: cpp failed with signal " << WTERMSIG(code) << endl;
+	exit( EXIT_FAILURE );
+    } // if
+
+    if ( WEXITSTATUS(code) != 0 ) {			// child error ?
+	unlink( tmpname );				// remove tmpname
+	exit( WEXITSTATUS( code ) );			// do not continue
+    } // if
+
+    // If -CFA flag specified, run the cfa-cpp preprocessor on the temporary file, and output is written to standard
+    // output.  Otherwise, run the cfa-cpp preprocessor on the temporary file and save the result into the output file.
+
+    if ( CFA_flag || fork() == 0 ) {			// conditional fork ?
+	uargs[0] = ( *new string( bprefix + "/cfa-cpp" ) ).c_str();
+
+	uargs[nuargs] = "-p";
+	nuargs += 1;
+
+	uargs[nuargs] = tmpname;
+	nuargs += 1;
+	if ( o_name != NULL ) {
+	    uargs[nuargs] = o_name;
+	    nuargs += 1;
+	} else if ( ! CFA_flag ) {			// run cfa-cpp ?
+	    uargs[nuargs] = cpp_out;
+	    nuargs += 1;
+	} // if
+	uargs[nuargs] = NULL;				// terminate argument list
+
+#ifdef __DEBUG_H__
+	cerr << "cfa-cpp nuargs: " << o_name << " " << CFA_flag << " " << nuargs << endl;
+	for ( i = 0; uargs[i] != NULL; i += 1 ) {
+	    cerr << uargs[i] << " ";
+	} // for
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	execvp( uargs[0], (char * const *)uargs );	// should not return
+	perror( "CFA Translator error: cpp level, execvp" );
+	exit( EXIT_FAILURE );
+    } // if
+
+    wait( &code );					// wait for child to finish
+
+#ifdef __DEBUG_H__
+    cerr << "return code from cfa-cpp:" << WEXITSTATUS(code) << endl;
+#endif // __DEBUG_H__
+
+    // Must unlink here because file must exist across execvp.
+    if ( unlink( tmpname ) == -1 ) {
+	perror( "CFA Translator error: cpp level, unlink" );
+	exit( EXIT_FAILURE );
+    } // if
+
+    if ( WIFSIGNALED(code) ) {				// child failed ?
+	cerr << "CFA Translator error: cfa-cpp failed with signal " << WTERMSIG(code) << endl;
+	exit( EXIT_FAILURE );
+    } // if
+
+    exit( WEXITSTATUS(code) );
+} // Stage1
+
+
+void Stage2( const int argc, const char * const * argv ) {
+    int i;
+
+    string arg;
+
+    const char *cpp_in = NULL;
+
+    const char *args[argc + 100];			// leave space for 100 additional cfa command line values
+    int nargs = 1;					// number of arguments in args list; 0 => command name
+
+    // process all the arguments
+
+    checkEnv( args, nargs );				// arguments passed via environment variables
+
+    for ( i = 1; i < argc; i += 1 ) {
+#ifdef __DEBUG_H__
+	cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	arg = argv[i];
+#ifdef __DEBUG_H__
+	cerr << "arg:\"" << arg << "\"" << endl;
+#endif // __DEBUG_H__
+	if ( prefix( arg, "-" ) ) {
+	    // strip inappropriate flags
+
+	    if ( arg == "-quiet" || arg == "-version" || arg == "-fpreprocessed" ||
+		 // Currently CFA does not suppose precompiled .h files.
+		 prefix( arg, "--output-pch" ) ) {
+
+	    // strip inappropriate flags with an argument
+
+	    } else if ( arg == "-auxbase" || arg == "-auxbase-strip" || arg == "-dumpbase" ) {
+		i += 1;
+#ifdef __DEBUG_H__
+		cerr << "arg:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+
+	    // all other flags
+
+	    } else {
+		args[nargs] = argv[i];			// pass the flag along
+		nargs += 1;
+		if ( arg == "-o" ) {
+		    i += 1;
+		    args[nargs] = argv[i];		// pass the argument along
+		    nargs += 1;
+#ifdef __DEBUG_H__
+		    cerr << "arg:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
 		} // if
-		args[nargs++] = cpp_in;
-		if ( o_flag ) {									// location for output
-			args[nargs++] = "-o";
-		} // if
-		args[nargs++] = cpp_out;
-		args[nargs] = nullptr;							// terminate argument list
-
-		#ifdef __DEBUG_H__
-		cerr << "nargs: " << nargs << endl;
-		for ( int i = 0; args[i] != nullptr; i += 1 ) {
-			cerr << args[i] << " ";
-		} // for
-		cerr << endl;
-		cerr << string( 100, '*' ) << endl;
-		#endif // __DEBUG_H__
-
-		execvp( args[0], (char * const *)args );		// should not return
-		perror( "CC1 Translator error: stage 1, execvp" );
+	    } // if
+	} else {					// obtain input and possibly output files
+	    if ( cpp_in == NULL ) {
+		cpp_in = argv[i];
+#ifdef __DEBUG_H__
+		cerr << "cpp_in:\"" << cpp_in << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else {
+		cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
 		exit( EXIT_FAILURE );
+	    } // if
 	} // if
-
-	// Run the C preprocessor and save the output in the given file.
-
-	if ( fork() == 0 ) {								// child process ?
-		// -o xxx.ii cannot be used to write the output file from cpp because no output file is created if cpp detects
-		// an error (e.g., cannot find include file). Whereas, output is always generated, even when there is an error,
-		// when cpp writes to stdout. Hence, stdout is redirected into the temporary file.
-		if ( freopen( cpp_out, "w", stdout ) == nullptr ) { // redirect stdout to output file
-			perror( "CC1 Translator error: stage 1, freopen" );
-			exit( EXIT_FAILURE );
-		} // if
-
-		args[0] = compiler_path.c_str();
-		if ( lang.size() == 0 ) {
-			suffix( cpp_in, args, nargs );				// check suffix
-		} else {
-			args[nargs++] = "-x";
-			args[nargs++] = ( *new string( lang ) ).c_str();
-		} // if
-		args[nargs++] = cpp_in;							// input to cpp
-		args[nargs] = nullptr;							// terminate argument list
-
-		#ifdef __DEBUG_H__
-		cerr << "cpp nargs: " << nargs << endl;
-		for ( int i = 0; args[i] != nullptr; i += 1 ) {
-			cerr << args[i] << " ";
-		} // for
-		cerr << endl;
-		#endif // __DEBUG_H__
-
-		execvp( args[0], (char * const *)args );		// should not return
-		perror( "CC1 Translator error: stage 1 cpp, execvp" );
-		cerr << " invoked " << args[0] << endl;
-		exit( EXIT_FAILURE );
-	} // if
-
-	wait( &code );										// wait for child to finish
-
-	#ifdef __DEBUG_H__
-	cerr << "return code from cpp:" << WEXITSTATUS(code) << endl;
-	#endif // __DEBUG_H__
-
-	if ( WIFSIGNALED(code) ) {							// child failed ?
-		rmtmpfile();									// remove tmpname
-		cerr << "CC1 Translator error: stage 1, child failed " << WTERMSIG(code) << endl;
-		exit( EXIT_FAILURE );
-	} // if
-
-	exit( WEXITSTATUS( code ) );						// bad cpp result stops top-level gcc
-} // Stage1
-
-
-static void Stage2( const int argc, const char * const * argv ) {
-	int code;
-	string arg;
-
-	const char * cpp_in = nullptr;
-	const char * cpp_out = nullptr;
-
-	const char * args[argc + 100];						// leave space for 100 additional cfa command line values
-	int nargs = 1;										// number of arguments in args list; 0 => command name
-	const char * cargs[20];								// leave space for 20 additional cfa-cpp command line values
-	int ncargs = 1;										// 0 => command name
-
-	#ifdef __DEBUG_H__
-	cerr << "#########" << endl << "Stage2 " << string( 100, '#' ) << endl << "#########" << endl;
-	#endif // __DEBUG_H__
-	checkEnv2( cargs, ncargs );							// arguments passed via environment variables
-	#ifdef __DEBUG_H__
-	cerr << string( 100, '*' ) << endl;
-	for ( int i = 1; i < argc; i += 1 ) {
-		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
-	} // for
-	cerr << string( 100, '*' ) << endl;
-	#endif // __DEBUG_H__
-
-	enum {
-		Color_Auto   = 0,
-		Color_Always = 1,
-		Color_Never  = 2,
-	} color_arg = Color_Auto;
-
-	const char * color_names[3] = { "--colors=auto", "--colors=always", "--colors=never" };
-
-	// process all the arguments
-
-	for ( int i = 1; i < argc; i += 1 ) {
-		arg = argv[i];
-		if ( prefix( arg, "-" ) ) {
-			// strip inappropriate flags
-
-			if ( prefix( arg, "-fdiagnostics-color=" ) ) {
-				string choice = arg.substr(20);
-				if ( choice == "always" ) color_arg = Color_Always;
-				else if ( choice == "never" ) color_arg = Color_Never;
-				else if ( choice == "auto" ) color_arg = Color_Auto;
-			} else if ( arg == "-fno-diagnostics-color" ) {
-				color_arg = Color_Auto;
-			} // if
-
-			if ( arg == "-quiet" || arg == "-version" || arg == "-fpreprocessed" ||
-				 // Currently CFA does not suppose precompiled .h files.
-				 prefix( arg, "--output-pch" ) ) {
-
-				// strip inappropriate flags with an argument
-
-			} else if ( arg == "-auxbase" || arg == "-auxbase-strip" ||
-						arg == "-dumpbase" || arg == "-dumpbase-ext" || arg == "-dumpdir" ) {
-				i += 1;
-				#ifdef __DEBUG_H__
-				cerr << "arg:\"" << argv[i] << "\"" << endl;
-				#endif // __DEBUG_H__
-
-				// all other flags
-
-			} else {
-				args[nargs++] = argv[i];				// pass flag along
-				if ( arg == "-o" ) {
-					i += 1;
-					cpp_out = argv[i];
-					args[nargs++] = argv[i];			// pass argument along
-					#ifdef __DEBUG_H__
-					cerr << "arg:\"" << argv[i] << "\"" << endl;
-					#endif // __DEBUG_H__
-				} // if
-			} // if
-		} else {										// obtain input and possibly output files
-			if ( cpp_in == nullptr ) {
-				cpp_in = argv[i];
-				#ifdef __DEBUG_H__
-				cerr << "cpp_in:\"" << cpp_in << "\"" << endl;
-				#endif // __DEBUG_H__
-			} else if ( cpp_out == nullptr ) {
-				cpp_out = argv[i];
-				#ifdef __DEBUG_H__
-				cerr << "cpp_out:\"" << cpp_out << "\""<< endl;
-				#endif // __DEBUG_H__
-			} else {
-				cerr << "Usage: " << argv[0] << " more than two files specified" << endl;
-				exit( EXIT_FAILURE );
-			} // if
-		} // if
-	} // for
-
-	if ( cpp_in == nullptr ) {
-		cerr << "Usage: " << argv[0] << " missing input file" << endl;
-		exit( EXIT_FAILURE );
-	} // if
-	if ( cpp_out == nullptr ) {
-		cerr << "Usage: " << argv[0] << " missing output file" << endl;
-		exit( EXIT_FAILURE );
-	} // if
-
-	// Create a temporary file, if needed, to store output of the cfa-cpp preprocessor. Cannot be created in forked
-	// process because variables tmpname and tmpfilefd are cloned.
-
-	string cfa_cpp_out;
-
-	if ( ! CFA_flag ) {									// run compiler ?
-		if ( save_temps ) {
-			cfa_cpp_out = cpp_in;
-			size_t dot = cfa_cpp_out.find_last_of( "." );
-			if ( dot == string::npos ) {
-				cerr << "CC1 Translator error: stage 2, bad file name " << endl;
-				exit( EXIT_FAILURE );
-			} // if
-
-			cfa_cpp_out = cfa_cpp_out.substr( 0, dot ) + CFA_SUFFIX;
-			if ( creat( cfa_cpp_out.c_str(), 0666 ) == -1 ) {
-				perror( "CC1 Translator error: stage 2, creat" );
-				exit( EXIT_FAILURE );
-			} // if
-		} else {
-			tmpfilefd = mkstemps( tmpname, 4 );
-			if ( tmpfilefd == -1 ) {
-				perror( "CC1 Translator error: stage 2, mkstemp" );
-				exit( EXIT_FAILURE );
-			} // if
-			cfa_cpp_out = tmpname;
-		} // if
-		#ifdef __DEBUG_H__
-		cerr << "cfa_cpp_out: " << cfa_cpp_out << endl;
-		#endif // __DEBUG_H__
-	} // if
-
-	// If -CFA flag specified, run the cfa-cpp preprocessor on the temporary file, and output is written to standard
-	// output.  Otherwise, run the cfa-cpp preprocessor on the temporary file and save the result into the output file.
-
-	if ( fork() == 0 ) {								// child runs CFA preprocessor
-		cargs[0] = ( *new string( bprefix + "cfa-cpp" ) ).c_str();
-		cargs[ncargs++] = cpp_in;
-
-		if ( CFA_flag ) {								// run cfa-cpp ?
-			if ( o_file.size() != 0 ) {					// location for output
-				cargs[ncargs++] = ( *new string( o_file ) ).c_str();
-			} // if
-		} else {
-			cargs[ncargs++] = cfa_cpp_out.c_str();
-		} // if
-
-		cargs[ncargs++] = color_names[color_arg];
-
-		cargs[ncargs] = nullptr;						// terminate argument list
-
-		#ifdef __DEBUG_H__
-		for ( int i = 0; cargs[i] != nullptr; i += 1 ) {
-			cerr << cargs[i] << " ";
-		} // for
-		cerr << endl;
-		#endif // __DEBUG_H__
-
-		execvp( cargs[0], (char * const *)cargs );		// should not return
-		perror( "CC1 Translator error: stage 2 cfa-cpp, execvp" );
-		cerr << " invoked " << cargs[0] << endl;
-		exit( EXIT_FAILURE );
-	} // if
-
-	wait( &code );										// wait for child to finish
-
-	if ( WIFSIGNALED(code) ) {							// child failed ?
-		rmtmpfile();									// remove tmpname
-		cerr << "CC1 Translator error: stage 2, child failed " << WTERMSIG(code) << endl;
-		exit( EXIT_FAILURE );
-	} // if
-
-	if ( CFA_flag ) {									// no tmpfile created
-		exit( WEXITSTATUS( code ) );					// stop regardless of success or failure
-	} // if
-
-	#ifdef __DEBUG_H__
-	cerr << "return code from cfa-cpp:" << WEXITSTATUS(code) << endl;
-	#endif // __DEBUG_H__
-
-	if ( WEXITSTATUS(code) ) {							// child error ?
-		rmtmpfile();									// remove tmpname
-		exit( WEXITSTATUS( code ) );					// do not continue
-	} // if
-
-	#ifdef __DEBUG_H__
-	cerr << "args:";
-	for ( int i = 1; i < nargs; i += 1 ) {
-		cerr << " " << args[i];
-	} // for
-	cerr << " " << cpp_in << endl;
-	#endif // __DEBUG_H__
-
-	if ( fork() == 0 ) {								// child runs gcc
-		args[0] = compiler_path.c_str();
-		args[nargs++] = "-S";							// only compile and put assembler output in specified file
-		args[nargs++] = "-x";
-		args[nargs++] = "cpp-output";
-
-		args[nargs++] = cfa_cpp_out.c_str();
-		args[nargs] = nullptr;							// terminate argument list
-
-		#ifdef __DEBUG_H__
-		cerr << "stage2 nargs: " << nargs << endl;
-		for ( int i = 0; args[i] != nullptr; i += 1 ) {
-			cerr << args[i] << " ";
-		} // for
-		cerr << endl;
-		#endif // __DEBUG_H__
-
-		execvp( args[0], (char * const *)args );		// should not return
-		perror( "CC1 Translator error: stage 2 cc1, execvp" );
-		cerr << " invoked " << args[0] << endl;
-		exit( EXIT_FAILURE );							// tell gcc not to go any further
-	} // if
-
-	wait( &code );										// wait for child to finish
-	rmtmpfile();										// remove tmpname
-
-	if ( WIFSIGNALED(code) ) {							// child failed ?
-		cerr << "CC1 Translator error: stage 2, child failed " << WTERMSIG(code) << endl;
-		exit( EXIT_FAILURE );
-	} // if
-
-	#ifdef __DEBUG_H__
-	cerr << "return code from gcc cc1:" << WEXITSTATUS(code) << endl;
-	#endif // __DEBUG_H__
-
-	exit( WEXITSTATUS( code ) );						// stop regardless of success or failure
+    } // for
+
+#ifdef __DEBUG_H__
+    cerr << "args:";
+    for ( i = 1; i < nargs; i += 1 ) {
+	cerr << " " << args[i];
+    } // for
+    cerr << endl;
+    if ( cpp_in != NULL ) cerr << " " << cpp_in;
+#endif // __DEBUG_H__
+
+    args[0] = compiler_name.c_str();
+    args[nargs] = "-S";					// only compile and put assembler output in specified file
+    nargs += 1;
+    args[nargs] = cpp_in;
+    nargs += 1;
+    args[nargs] = NULL;					// terminate argument list
+
+#ifdef __DEBUG_H__
+    cerr << "stage2 nargs: " << nargs << endl;
+    for ( i = 0; args[i] != NULL; i += 1 ) {
+	cerr << args[i] << " ";
+    } // for
+    cerr << endl;
+#endif // __DEBUG_H__
+
+    execvp( args[0], (char * const *)args );		// should not return
+    perror( "CFA Translator error: cpp level, execvp" );
+    exit( EXIT_FAILURE );				// tell gcc not to go any further
 } // Stage2
 
 
-// This program is called twice because of the -no-integrated-cpp. The calls are differentiated by the first
-// command-line argument. The first call replaces the traditional cpp pass to preprocess the C program. The second call
-// is to the compiler, which is broken into two steps: preprocess again with cfa-cpp and then call gcc to compile the
-// doubly preprocessed program.
-
-int main( const int argc, const char * const argv[], __attribute__((unused)) const char * const env[] ) {
-	#ifdef __DEBUG_H__
-	cerr << "#########" << endl << "main cc1 " << string( 100, '#' ) << endl << "#########" << endl;
-	#endif // __DEBUG_H__
-
-	signal( SIGINT,  sigTermHandler );
-	signal( SIGTERM, sigTermHandler );
-
-	string arg( argv[1] );
-
-	// Currently, stage 1 starts with flag -E and stage 2 with flag -fpreprocessed.
-
-	if ( arg == "-E" ) {
-		Stage1( argc, argv );
-	} else if ( arg == "-fpreprocessed" ) {
-		Stage2( argc, argv );
-	} else {
-		cerr << "Usage: " << argv[0] << " [-E input-file [output-file] ] | [-fpreprocessed input-file output-file] [options]" << endl;
-		exit( EXIT_FAILURE );
-	} // if
+int main( const int argc, const char * const argv[], const char * const env[] ) {
+#ifdef __DEBUG_H__
+    for ( int i = 0; env[i] != NULL; i += 1 ) {
+	cerr << env[i] << endl;
+    } // for
+#endif // __DEBUG_H__
+
+    string arg = argv[1];
+
+    // Currently, stage 1 starts with flag -E and stage 2 with flag -fpreprocessed.
+
+    if ( arg == "-E" ) {
+#ifdef __DEBUG_H__
+	cerr << "Stage1" << endl;
+#endif // __DEBUG_H__
+	Stage1( argc, argv );
+    } else if ( arg == "-fpreprocessed" ) {
+#ifdef __DEBUG_H__
+	cerr << "Stage2" << endl;
+#endif // __DEBUG_H__
+	Stage2( argc, argv );
+    } else {
+	cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
+	exit( EXIT_FAILURE );
+    } // if
 } // main
 
+
 // Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
 // compile-command: "make install" //
 // End: //
Index: driver/cfa.cc
===================================================================
--- driver/cfa.cc	(revision a9049dd64205261c925e9c9e1b7b6ef7b1da8073)
+++ driver/cfa.cc	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
@@ -1,580 +1,342 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// cfa.cc --
-//
+//                              -*- Mode: C++ -*- 
+// 
+// CForall Version 1.0, Copyright (C) Peter A. Buhr 2002
+// 
+// cfa.cc -- 
+// 
 // Author           : Peter A. Buhr
 // Created On       : Tue Aug 20 13:44:49 2002
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Sep 28 21:53:54 2023
-// Update Count     : 484
-//
+// Last Modified On : Fri Oct 17 18:03:15 2014
+// Update Count     : 95
+// 
 
 #include <iostream>
-#include <cstdio>										// perror
-#include <cstdlib>										// putenv, exit
-#include <climits>										// PATH_MAX
-#include <string>										// STL version
-#include <algorithm>									// find
-using namespace std;
-
-#include <unistd.h>										// execvp
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "Common/SemanticError.hpp"
-#include "config.h"										// configure info
+#include <cstdio>					// perror
+#include <cstdlib>					// putenv, exit
+#include <unistd.h>					// execvp
+#include <string>					// STL version
+
+#include "config.h"					// configure info
+
+using std::cerr;
+using std::endl;
+using std::string;
+
 
 //#define __DEBUG_H__
 
-#define xstr(s) str(s)
-#define str(s) #s
-
-static string __CFA_FLAGPREFIX__( "__CFA_FLAG" );		// "__CFA_FLAG__=" suffix
-
-static void Putenv( char * argv[], string arg ) {
-	// environment variables must have unique names
-	static int flags = 0;
-
-    // This allocation 'leaks' memory from the program to the execution
-    // environment, as putenv does not manage the storage of the string used
-    // as an environment variable. This leak is necessary to ensure the
-    // underlying C string is allocated long enough.
-	if ( putenv( (char *)( *new string( string( __CFA_FLAGPREFIX__ + to_string( flags++ ) + "__=" ) + arg ) ).c_str() ) ) {
-		cerr << argv[0] << " error, cannot set environment variable." << endl;
-		exit( EXIT_FAILURE );
+
+bool prefix( string arg, string pre ) {
+    return arg.substr( 0, pre.size() ) == pre;
+} // prefix
+
+
+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__
+    cerr << "shuffle:" << S << " " << E << " " << N << endl;
+#endif // __DEBUG_H__
+    for ( int j = E-1 + N; j > S-1 + N; j -=1 ) {
+#ifdef __DEBUG_H__
+	cerr << "\t" << j << " " << j-N << endl;
+#endif // __DEBUG_H__
+	args[j] = args[j-N];
+    } // for
+} // shuffle
+
+
+int main( int argc, char *argv[] ) {
+    string Version( VERSION );				// current version number from CONFIG
+    string Major( "0" ), Minor( "0" ), Patch( "0" );	// default version numbers
+    int posn1 = Version.find( "." );			// find the divider between major and minor version numbers
+    if ( posn1 == -1 ) {				// not there ?
+	Major = Version;
+    } else {
+	Major = Version.substr( 0, posn1 );
+	int posn2 = Version.find( ".", posn1 + 1 );	// find the divider between minor and patch numbers
+	if ( posn2 == -1 ) {				// not there ?
+	    Minor = Version.substr( posn1 );
+	} else {
+	    Minor = Version.substr( posn1 + 1, posn2 - posn1 - 1 );
+	    Patch = Version.substr( posn2 + 1 );
 	} // if
-} // Putenv
-
-static bool prefix( const string & arg, const string & pre ) { // check if string has prefix
-	return arg.substr( 0, pre.size() ) == pre;
-} // prefix
-
-// check if string has suffix
-static bool suffix( const string & arg ) {
-	enum { NumSuffixes = 3 };
-	static const string suffixes[NumSuffixes] = { "cfa", "hfa", "ifa" };
-
-	size_t dot = arg.find_last_of( "." );
-	if ( dot == string::npos ) return false;
-	const string * end = suffixes + NumSuffixes;
-	return std::find( suffixes, end, arg.substr( dot + 1 ) ) != end;
-} // suffix
-
-static inline bool dirExists( const string & path ) {	// check if directory exists
-    struct stat info;
-    if ( stat( path.c_str(), &info ) != 0 ) return false;
-	return (info.st_mode & S_IFDIR) != 0;
-} // dirExists
-
-static inline string dir(const string & path) {
-	return path.substr(0, path.find_last_of('/'));
-} // dir
-
-// Different path modes
-enum PathMode {
-	Installed,     // cfa is installed, use prefix
-	BuildTree,     // cfa is in the tree, use source and build tree
-	Distributed    // cfa is distributed, use build tree for includes and executable directory for .cfs
-};
-
-// Get path mode from /proc
-PathMode FromProc() {
-	std::string abspath;
-	abspath.resize(PATH_MAX);
-
-	// get executable path from /proc/self/exe
-	ssize_t size = readlink("/proc/self/exe", const_cast<char*>(abspath.c_str()), abspath.size());
-	if ( size <= 0 ) {
-		std::cerr << "Error could not evaluate absolute path from /proc/self/exe" << std::endl;
-		std::cerr << "Failed with " << std::strerror(errno) << std::endl;
-		std::exit(1);
+    } // if
+
+    string installlibdir( CFA_LIBDIR );			// fixed location of the cpp and cfa-cpp commands
+
+    string heading;					// banner printed at start of cfa compilation
+    string arg;						// current command-line argument during command-line parsing
+    string Bprefix;					// path where gcc looks for compiler command steps
+    string langstd;					// language standard
+
+    string compiler_path( GCC_PATH );			// path/name of C compiler
+    string compiler_name;				// name of C compiler
+
+    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 help = false;					// -help flag
+    bool CFA_flag = false;				// -CFA flag
+    bool cpp_flag = false;				// -E or -M flag, preprocessor only
+    bool debugging = false;				// -g flag
+
+    const char *args[argc + 100];			// cfa command line values, plus some space for additional flags
+    int sargs = 1;					// starting location for arguments in args list
+    int nargs = sargs;					// number of arguments in args list; 0 => command name
+
+    const char *libs[argc + 20];			// non-user libraries must come separately, plus some added libraries and flags
+    int nlibs = 0;
+
+#ifdef __DEBUG_H__
+    cerr << "CFA:" << endl;
+#endif // __DEBUG_H__
+
+    // process command-line arguments
+
+    for ( int i = 1; i < argc; i += 1 ) {
+#ifdef __DEBUG_H__
+	cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	arg = argv[i];					// convert to string value
+#ifdef __DEBUG_H__
+	cerr << "arg:\"" << arg << "\"" << endl;
+#endif // __DEBUG_H__
+	if ( prefix( arg, "-" ) ) {
+	    // pass through arguments
+
+	    if ( arg == "-Xlinker" || arg == "-o" ) {
+		args[nargs] = argv[i];			// pass the argument along
+		nargs += 1;
+		i += 1;
+		if ( i == argc ) continue;		// next argument available ?
+		args[nargs] = argv[i];			// pass the argument along
+		nargs += 1;
+	    } else if ( arg == "-XCFA" ) {		// CFA pass through
+		i += 1;
+		args[nargs] = ( *new string( string("-D__CFA_FLAG__=") + argv[i] ) ).c_str();
+		nargs += 1;
+
+	    // CFA specific arguments
+
+	    } else if ( arg == "-CFA" ) {
+		CFA_flag = true;			// strip the -CFA flag
+		link = false;
+		args[nargs] = "-E";			// replace the argument with -E
+		nargs += 1;
+	    } else if ( arg == "-debug" ) {
+		debug = true;				// strip the debug flag
+	    } else if ( arg == "-nodebug" ) {
+		debug = false;				// strip the nodebug flag
+	    } else if ( arg == "-quiet" ) {
+		quiet = true;				// strip the quiet flag
+	    } else if ( arg == "-noquiet" ) {
+		quiet = false;				// strip the noquiet flag
+	    } else if ( arg == "-help" ) {
+		help = true;				// strip the help flag
+	    } else if ( arg == "-nohelp" ) {
+		help = false;				// strip the nohelp flag
+
+	    // C++ specific arguments
+
+	    } else if ( arg == "-v" ) {
+		verbose = true;				// verbosity required
+		args[nargs] = argv[i];			// pass the argument along
+		nargs += 1;
+	    } else if ( arg == "-g" ) {
+		debugging = true;			// symbolic debugging required
+		args[nargs] = argv[i];			// pass the argument along
+		nargs += 1;
+	    } else if ( prefix( arg, "-B" ) ) {
+		Bprefix = arg.substr(2);		// strip the -B flag
+		args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
+		nargs += 1;
+	    } else if ( prefix( arg, "-b" ) ) {
+		if ( arg.length() == 2 ) {		// separate argument ?
+		    i += 1;
+		    if ( i == argc ) continue;		// next argument available ?
+		    arg += argv[i];			// concatenate argument
+		} // if
+		// later versions of gcc require the -b option to appear at the start of the command line
+		shuffle( args, sargs, nargs, 1 );	// make room at front of argument list
+		args[sargs] = ( *new string( arg ) ).c_str(); // pass the argument along
+		if ( putenv( (char *)( *new string( string( "__GCC_MACHINE__=" ) + arg ) ).c_str() ) != 0 ) {
+		    cerr << argv[0] << " error, cannot set environment variable." << endl;
+		    exit( EXIT_FAILURE );
+		} // if
+		sargs += 1;
+		nargs += 1;
+	    } else if ( prefix( arg, "-V" ) ) {
+		if ( arg.length() == 2 ) {		// separate argument ?
+		    i += 1;
+		    if ( i == argc ) continue;		// next argument available ?
+		    arg += argv[i];			// concatenate argument
+		} // if
+		// later versions of gcc require the -V option to appear at the start of the command line
+		shuffle( args, sargs, nargs, 1 );	// make room at front of argument list
+		args[sargs] = ( *new string( arg ) ).c_str(); // pass the argument along
+		if ( putenv( (char *)( *new string( string( "__GCC_VERSION__=" ) + arg ) ).c_str() ) != 0 ) {
+		    cerr << argv[0] << " error, cannot set environment variable." << endl;
+		    exit( EXIT_FAILURE );
+		} // if
+		sargs += 1;
+		nargs += 1;
+	    } else if ( arg == "-c" || arg == "-S" || arg == "-E" || arg == "-M" || arg == "-MM" ) {
+		args[nargs] = argv[i];			// pass the argument along
+		nargs += 1;
+		if ( arg == "-E" || arg == "-M" || arg == "-MM" ) {
+		    cpp_flag = true;			// cpp only
+		} // if
+		link = false;                           // no linkage required
+	    } else if ( arg[1] == 'l' ) {
+		// if the user specifies a library, load it after user code
+		libs[nlibs] = argv[i];
+		nlibs += 1;
+	    } else {
+		// concatenate any other arguments
+		args[nargs] = argv[i];
+		nargs += 1;
+	    } // if
+	} else {
+	    // concatenate other arguments
+	    args[nargs] = argv[i];
+	    nargs += 1;
+	    nonoptarg = true;
 	} // if
-
-	// Trim extra characters
-	abspath.resize(size);
-
-	// Are we installed
-	if ( abspath.rfind(CFA_BINDIR, 0) == 0 ) { return Installed; }
-
-	// Is this the build tree
-	if ( abspath.rfind(TOP_BUILDDIR, 0 ) == 0 ) { return BuildTree; }
-
-	// Does this look like distcc
-	if ( abspath.find( "/.cfadistcc/" ) != std::string::npos ) { return Distributed; }
-
-	// None of the above? Give up since we don't know where the prelude or include directories are
-	std::cerr << "Cannot find required files from excutable path " << abspath << std::endl;
-	std::exit(1);
-}
-
-
-int main( int argc, char * argv[] ) {
-	string Version( CFA_VERSION_LONG );					// current version number from CONFIG
-	string Major( xstr( CFA_VERSION_MAJOR ) ), Minor( xstr( CFA_VERSION_MINOR ) ), Patch( xstr( CFA_VERSION_PATCH ) );
-
-	string installincdir( CFA_INCDIR );					// fixed location of include files
-	string installlibdir( CFA_LIBDIR );					// fixed location of cc1 and cfa-cpp commands when installed
-	string srcdriverdir ( TOP_BUILDDIR "driver");		// fixed location of cc1 and cfa-cpp commands when in tree
-
-	string heading;										// banner printed at start of cfa compilation
-	string arg;											// current command-line argument during command-line parsing
-	string bprefix;										// path where gcc looks for compiler steps
-	string langstd;										// language standard
-
-	string compiler_path( CFA_BACKEND_CC );				// path/name of C compiler
-	string compiler_name;								// name of C compiler
-
-	bool x_flag = false;								// -x flag
-	bool nonoptarg = false;								// no non-option arguments specified, i.e., no file names
-	bool link = true;									// link stage occurring
-	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 CFA_flag = false;								// -CFA flag
-	bool cpp_flag = false;								// -E or -M flag, preprocessor only
-	bool std_flag = false;								// -std= flag
-	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 compiling_libs = false;
-	int o_file = 0;										// -o filename position
-
-	PathMode path = FromProc();
-
-	const char * args[argc + 100];						// cfa command line values, plus some space for additional flags
-	int sargs = 1;										// starting location for arguments in args list
-	int nargs = sargs;									// number of arguments in args list; 0 => command name
-
-	const char * libs[argc + 20];						// non-user libraries must come separately, plus some added libraries and flags
-	int nlibs = 0;
-
-	#ifdef __DEBUG_H__
-	cerr << "CFA:" << endl;
-	for ( int i = 1; i < argc; i += 1 ) {
-	    cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
-	} // for
-	#endif // __DEBUG_H__
-
-	// process command-line arguments
-
-	for ( int i = 1; i < argc; i += 1 ) {
-		arg = argv[i];									// convert to string value
-		if ( prefix( arg, "-" ) ) {
-			// pass through arguments
-
-			if ( arg == "-Xlinker" || arg == "-o" ) {
-				args[nargs++] = argv[i];				// pass flag along
-				i += 1;
-				if ( i == argc ) continue;				// next argument available ?
-				args[nargs++] = argv[i];				// pass argument along
-				if ( arg == "-o" ) o_file = i;			// remember file
-
-				// CFA specific arguments
-
-			} else if ( strncmp(arg.c_str(), "-XCFA", 5) == 0 ) { // CFA pass through
-				if ( arg.size() == 5 ) {
-					i += 1;
-					if ( i == argc ) continue;			// next argument available ?
-					Putenv( argv, argv[i] );			// make available for cc1
-				} else if ( arg[5] == ',' ) {			// CFA specific arguments
-					string xcfargs = arg.substr( 6 ) + ","; // add sentinel
-					for ( ;; ) {
-						size_t posn = xcfargs.find_first_of( "," ); // find separator
-					  if ( posn == string::npos ) break; // any characters left ?
-						string xcfarg = xcfargs.substr( 0, posn ); // remove XCFA argument
-						Putenv( argv, xcfarg );			// make available for cc1
-						xcfargs.erase( 0, posn + 1 );	// remove first argument and comma
-					} // for
-				} else {								// CFA specific arguments
-					assert( false );					// this does not make sense
-					args[nargs++] = argv[i];
-				} // if
-			} else if ( arg == "-CFA" ) {
-				CFA_flag = true;						// strip -CFA flag
-				link = false;
-				args[nargs++] = "-fsyntax-only";		// stop after stage 2
-			} else if ( arg == "-debug" ) {
-				debug = true;							// strip debug flag
-			} else if ( arg == "-nodebug" ) {
-				debug = false;							// strip nodebug flag
-			} else if ( arg == "-quiet" ) {
-				quiet = true;							// strip quiet flag
-			} else if ( arg == "-noquiet" ) {
-				quiet = false;							// strip noquiet flag
-			} else if ( arg == "-invariant" ) {
-				Putenv( argv, "-" + arg );
-			} else if ( arg == "--invariant" ) {
-				Putenv( argv, arg );
-			} else if ( arg == "-no-include-stdhdr" ) {
-				noincstd_flag = true;					// strip no-include-stdhdr flag
-			} else if ( arg == "-nolib" ) {
-				nolib = true;							// strip nolib flag
-			} else if ( arg == "-help" ) {
-				help = true;							// strip help flag
-			} else if ( arg == "-nohelp" ) {
-				help = false;							// strip nohelp flag
-			} else if ( arg == "-cfalib") {
-				compiling_libs = true;
-			} else if ( arg == "-compiler" ) {
-				// use the user specified compiler
-				i += 1;
-				if ( i == argc ) continue;				// next argument available ?
-				compiler_path = argv[i];
-				Putenv( argv, arg + "=" + argv[i] );
-
-				// C specific arguments
-
-			} else if ( arg == "-v" ) {
-				verbose = true;							// verbosity required
-				args[nargs++] = argv[i];				// pass flag along
-			} else if ( arg == "-g" ) {
-				debugging = true;						// symbolic debugging required
-				args[nargs++] = argv[i];				// pass flag along
-			} else if ( arg == "-save-temps" || arg == "--save-temps" ) {
-				args[nargs++] = argv[i];				// pass flag along
-				Putenv( argv, arg );					// save cfa-cpp output
-			} else if ( prefix( arg, "-x" ) ) {			// file suffix ?
-				string lang;
-				args[nargs++] = argv[i];				// pass flag along
-				if ( arg.length() == 2 ) {				// separate argument ?
-					i += 1;
-					if ( i == argc ) continue;			// next argument available ?
-					lang = argv[i];
-					args[nargs++] = argv[i];			// pass argument along
-				} else {
-					lang = arg.substr( 2 );
-				} // if
-				if ( x_flag ) {
-					cerr << argv[0] << " warning, only one -x flag per compile, ignoring subsequent flag." << endl;
-				} else {
-					x_flag = true;
-					Putenv( argv, string( "-x=" ) + lang );
-				} // if
-			} else if ( prefix( arg, "-std=" ) || prefix( arg, "--std=" ) ) {
-				std_flag = true;						// -std=XX provided
-				args[nargs++] = argv[i];				// pass flag along
-			} else if ( arg == "-w" ) {
-				args[nargs++] = argv[i];				// pass flag along
-				Putenv( argv, arg );
-			} else if ( prefix( arg, "-W" ) ) {			// check before next tests
-				if ( arg == "-Werror" || arg == "-Wall" ) {
-					args[nargs++] = argv[i];			// pass flag along
-					Putenv( argv, argv[i] );
-				} else {
-					unsigned int adv = prefix( arg, "-Wno-" ) ? 5 : 2;
-					args[nargs] = argv[i];				// conditionally pass argument along
-					const char * warning = argv[i] + adv; // extract warning
-					if ( SemanticWarning_Exist( warning ) ) { // replace the argument for cfa-cpp
-						Putenv( argv, arg );
-					} // if
-					nargs += 1;
-				} // if
-			} else if ( prefix( arg, "-B" ) ) {
-				bprefix = arg.substr(2);				// strip -B flag
-			} else if ( arg == "-c" || arg == "-S" || arg == "-E" || arg == "-M" || arg == "-MM" ) {
-				args[nargs++] = argv[i];				// pass flag along
-				if ( arg == "-E" || arg == "-M" || arg == "-MM" ) {
-					cpp_flag = true;					// cpp only
-				} // if
-				link = false;                           // no linkage required
-			} else if ( arg == "-D" || arg == "-U" || arg == "-I" || arg == "-MF" || arg == "-MT" || arg == "-MQ" ||
-						arg == "-include" || arg == "-imacros" || arg == "-idirafter" || arg == "-iprefix" ||
-						arg == "-iwithprefix" || arg == "-iwithprefixbefore" || arg == "-isystem" || arg == "-isysroot" ) {
-				args[nargs++] = argv[i];				// pass flag along
-				i += 1;
-				args[nargs++] = argv[i];				// pass argument along
-			} else if ( arg[1] == 'l' ) {
-				// if the user specifies a library, load it after user code
-				libs[nlibs++] = argv[i];
-			} else if ( arg == "-m32" ) {
-				m32 = true;
-				m64 = false;
-				args[nargs++] = argv[i];
-			} else if ( arg == "-m64" ) {
-				m64 = true;
-				m32 = false;
-				args[nargs++] = argv[i];
-			} else {
-				// concatenate any other arguments
-				args[nargs++] = argv[i];
-			} // if
-		} else {
-			bool cfa = suffix( arg );					// check suffix
-			if ( ! x_flag && cfa ) {					// no explicit suffix and cfa suffix ?
-				args[nargs++] = "-x";
-				args[nargs++] = "c";
-			} // if
-			args[nargs++] = argv[i];					// concatenate files
-			if ( ! x_flag && cfa ) {					// no explicit suffix and cfa suffix ?
-				args[nargs++] = "-x";
-				args[nargs++] = "none";
-			} // if
-			nonoptarg = true;
-		} // if
-	} // for
-
-	#ifdef __x86_64__
-	args[nargs++] = "-mcx16";							// allow double-wide CAS
-	#endif // __x86_64__
-
-	// ARM -mno-outline-atomics => use LL/SC instead of calls to atomic routines: __aarch64_swp_acq_rel, __aarch64_cas8_acq_rel
-	// ARM -march=armv8.2-a+lse => generate Arm LSE extension instructions SWAP and CAS
-	// https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/making-the-most-of-the-arm-architecture-in-gcc-10
-	#ifdef __ARM_ARCH
-	args[nargs++] = "-mno-outline-atomics";				// use ARM LL/SC instructions for atomics
-	// args[nargs++] = "-march=armv8.2-a+lse";				// use atomic instructions
-	#endif // __ARM_ARCH
-
-	#ifdef __DEBUG_H__
-	cerr << "args:";
-	for ( int i = 1; i < nargs; i += 1 ) {
-		cerr << " " << args[i];
+    } // for
+
+#ifdef __DEBUG_H__
+    cerr << "args:";
+    for ( int i = 1; i < nargs; i += 1 ) {
+	cerr << " " << args[i];
+    } // for
+    cerr << endl;
+#endif // __DEBUG_H__
+
+    if ( cpp_flag && CFA_flag ) {
+	cerr << argv[0] << " error, cannot use -E and -CFA flags together." << endl;
+	exit( EXIT_FAILURE );
+    } // if
+
+    string d;
+    if ( debug ) {
+	d = "-d";
+    } // if
+
+    if ( link ) {
+	// include the cfa library in case it's needed
+	args[nargs] = "-L" CFA_LIBDIR;
+	nargs += 1;
+	args[nargs] = "-lcfa";
+	nargs += 1;
+    } // if
+
+    // add the correct set of flags based on the type of compile this is
+
+    args[nargs] = ( *new string( string("-D__CFA_MAJOR__=") + Major ) ).c_str();
+    nargs += 1;
+    args[nargs] = ( *new string( string("-D__CFA_MINOR__=") + Minor ) ).c_str();
+    nargs += 1;
+
+    if ( cpp_flag ) {
+	args[nargs] = "-D__CPP__";
+	nargs += 1;
+    } // if
+
+    if ( CFA_flag ) {
+	args[nargs] = "-D__CFA__";
+	nargs += 1;
+    } // if
+
+    if ( debug ) {
+	heading += " (debug)";
+	args[nargs] = "-D__CFA_DEBUG__";
+	nargs += 1;
+    } else {
+	heading += " (no debug)";
+    } // if
+
+    if ( Bprefix.length() == 0 ) {
+	Bprefix = installlibdir;
+	args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
+	nargs += 1;
+    } // if
+
+    // execute the compilation command
+
+    args[0] = compiler_path.c_str();			// set compiler command for exec
+    // find actual name of the compiler independent of the path to it
+    int p = compiler_path.find_last_of( '/' );		// scan r -> l for first '/'
+    if ( p == -1 ) {
+	compiler_name = compiler_path;
+    } else {
+	compiler_name = *new string( compiler_path.substr( p + 1 ) );
+    } // if
+
+    if ( prefix( compiler_name, "gcc" ) ) {		// allow suffix on gcc name
+	args[nargs] = "-no-integrated-cpp";
+	nargs += 1;
+	args[nargs] = "-Wno-deprecated"; 
+	nargs += 1;
+	args[nargs] = ( *new string( string("-B") + Bprefix + "/" ) ).c_str();
+	nargs += 1;
+    } else {
+	cerr << argv[0] << " error, compiler " << compiler_name << " not supported." << endl;
+	exit( EXIT_FAILURE );
+    } // if
+
+    for ( int i = 0; i < nlibs; i += 1 ) {		// copy non-user libraries after all user libraries
+	args[nargs] = libs[i];
+	nargs += 1;
+    } // for
+
+    args[nargs] = NULL;					// terminate with NULL
+
+#ifdef __DEBUG_H__
+    cerr << "nargs: " << nargs << endl;
+    cerr << "args:" << endl;
+    for ( int i = 0; args[i] != NULL; i += 1 ) {
+	cerr << " \"" << args[i] << "\"" << endl;
+    } // for
+#endif // __DEBUG_H__
+
+    if ( ! quiet ) {
+	cerr << "CFA " << "Version " << Version << heading << endl;
+
+	if ( help ) {
+	    cerr <<
+		"-debug\t\t\t: use cfa runtime with debug checking" << endl <<
+		"-help\t\t\t: print this help message" << endl <<
+		"-quiet\t\t\t: print no messages from the cfa command" << endl <<
+		"-CFA\t\t\t: run the cpp preprocessor and the cfa-cpp translator" << endl <<
+		"-XCFA -cfa-cpp-flag\t: pass next flag as-is to the cfa-cpp translator" << endl <<
+		"...\t\t\t: any other " << compiler_name << " flags" << endl;
+	} // if
+    } // if
+
+    if ( verbose ) {
+	if ( argc == 2 ) exit( EXIT_SUCCESS );		// if only the -v flag is specified, do not invoke gcc
+
+	for ( int i = 0; args[i] != NULL; i += 1 ) {
+	    cerr << args[i] << " ";
 	} // for
 	cerr << endl;
-	#endif // __DEBUG_H__
-
-	// -E flag stops at cc1 stage 1, so cfa-cpp in cc1 stage 2 is never executed.
-	if ( cpp_flag && CFA_flag ) {
-		CFA_flag = false;
-		cerr << argv[0] << " warning, both -E and -CFA flags specified, using -E and ignoring -CFA." << endl;
-	} // if
-
-	// add the CFA include-library paths, which allow direct access to header files without directory qualification
-	string libbase;
-	switch(path) {
-	  case Installed:
-		args[nargs++] = "-I" CFA_INCDIR;
-		// do not use during build
-		if ( ! noincstd_flag ) {
-			args[nargs++] = "-I" CFA_INCDIR "stdhdr";
-		} // if
-		args[nargs++] = "-I" CFA_INCDIR "concurrency";
-		args[nargs++] = "-I" CFA_INCDIR "collections";
-		libbase = CFA_LIBDIR;
-		break;
-	  case BuildTree:
-	  case Distributed:
-		args[nargs++] = "-I" TOP_SRCDIR "libcfa/src";
-		// do not use during build
-		if ( ! noincstd_flag ) {
-			args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/stdhdr";
-		} // if
-		args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/concurrency";
-		args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/collections";
-
-		libbase = TOP_BUILDDIR "libcfa/";
-
-		break;
-	} // if
-
-	// add stdbool to get defines for bool/true/false
-	args[nargs++] = "-imacros";
-	args[nargs++] = "stdbool.h";
-
-	if ( compiling_libs ) {
-		Putenv( argv, "-t" );
-	} // if
-
-	string arch( m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU) );
-	if ( ! m32 && ! m64 ) {
-		if ( arch == "x86" ) {
-			args[nargs++] = "-m32";
-		} else if ( arch == "x64" ) {
-			args[nargs++] = "-m64";
-		}  // if
-	} // if
-
-	const char * config = nolib ? "nolib" : (debug ? "debug": "nodebug");
-	string libdir = libbase + arch + "-" + config;
-
-	if ( path != Distributed ) {
-		if ( ! nolib && ! dirExists( libdir ) ) {
-			cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
-			cerr << "Was looking for " << libdir << endl;
-			for(int i = 1; i < argc; i++) {
-				cerr << argv[i] << " ";
-			}
-			cerr << endl;
-			libdir = libbase + arch + "-" + "nolib";
-		} // if
-
-		if ( ! dirExists( libdir ) ) {
-			cerr << argv[0] << " internal error, cannot find prelude directory." << endl;
-			cerr << "Was looking for " << libdir << endl;
-			exit( EXIT_FAILURE );
-		} // if
-	} // if
-
-	string preludedir;
-	switch(path) {
-	  case Installed   : preludedir = libdir; break;
-	  case BuildTree   : preludedir = libdir + "/prelude"; break;
-	  case Distributed : preludedir = dir(argv[0]); break;
-	} // switch
-
-	Putenv( argv, "--prelude-dir=" + preludedir );
-	args[nargs++] = "-include";
-	args[nargs++] = (*new string(preludedir + "/defines.hfa")).c_str();
-
-	for ( int i = 0; i < nlibs; i += 1 ) {				// copy non-user libraries after all user libraries
-		args[nargs++] = libs[i];
-	} // for
-
-	if ( link ) {
-		args[nargs++] = "-Xlinker";
-		args[nargs++] = "--undefined=__cfaabi_dbg_bits_write";
-		args[nargs++] = "-Xlinker";
-		args[nargs++] = "--undefined=__cfaabi_interpose_startup";
-		args[nargs++] = "-Xlinker";
-		args[nargs++] = "--undefined=__cfaabi_appready_startup";
-		args[nargs++] = "-z";
-		args[nargs++] = "execstack";
-
-		// include the cfa library in case it is needed
-		args[nargs++] = ( *new string( string("-L" ) + libdir + (path != Installed ? "/src/.libs" : "")) ).c_str();
-		args[nargs++] = ( *new string( string("-Wl,-rpath," ) + libdir + (path != Installed ? "/src/.libs" : "")) ).c_str();
-		args[nargs++] = "-Wl,--push-state,--as-needed";
-		args[nargs++] = "-lcfathread";
-		args[nargs++] = "-Wl,--pop-state";
-		args[nargs++] = "-Wl,--push-state,--no-as-needed";
-		args[nargs++] = "-lcfa";
-		args[nargs++] = "-Wl,--pop-state";
-		args[nargs++] = "-pthread";
-		#if defined(  __x86_64__ ) || defined( __ARM_ARCH )
-		args[nargs++] = "-latomic";						// allow double-wide CAS
-		#endif // __x86_64__
-		args[nargs++] = "-ldl";
-		args[nargs++] = "-lm";
-	} // if
-
-	args[nargs++] = "-fexceptions";						// add exception flags (unconditionally)
-	args[nargs++] = "-D_GNU_SOURCE";					// force gnu libraries
-
-	// add flags based on the type of compile
-
-	args[nargs++] = ( *new string( string("-D__CFA_MAJOR__=") + Major ) ).c_str();
-	args[nargs++] = ( *new string( string("-D__CFA_MINOR__=") + Minor ) ).c_str();
-	args[nargs++] = ( *new string( string("-D__CFA_PATCH__=") + Patch ) ).c_str();
-	args[nargs++] = "-D__CFA__";
-	args[nargs++] = "-D__CFORALL__";
-	args[nargs++] = "-D__cforall";
-
-	if ( cpp_flag ) {
-		args[nargs++] = "-D__CPP__";
-	} // if
-
-	if ( CFA_flag ) {
-		Putenv( argv, "-N" );
-		Putenv( argv, "-CFA" );
-		// -CFA implies cc1 stage 2, but gcc does not pass the -o file to this stage because it believe the file is for
-		// the linker. Hence, the -o file is explicit passed to cc1 stage 2 and used as cfa-cpp's output file.
-		if ( o_file ) Putenv( argv, string( "-o=" ) + argv[o_file] );
-	} else {
-		Putenv( argv, "-L" );
-	} // if
-
-	if ( debug ) {
-		heading += " (debug)";
-		args[nargs++] = "-D__CFA_DEBUG__";
-	} else {
-		heading += " (no debug)";
-	} // if
-
-	if ( bprefix.length() == 0 ) {
-		switch(path) {
-		  case Installed   : bprefix = installlibdir; break;
-		  case BuildTree   : bprefix = srcdriverdir ; break;
-		  case Distributed : bprefix = dir(argv[0]) ; break;
-		} // switch
-	} // if
-	if ( bprefix[bprefix.length() - 1] != '/' ) bprefix += '/';
-	Putenv( argv, string("-B=") + bprefix );
-
-	args[nargs++] = "-Xlinker";							// used by backtrace
-	args[nargs++] = "-export-dynamic";
-
-	// execute the compilation command
-
-	args[0] = compiler_path.c_str();					// set compiler command for exec
-	// find actual name of the compiler independent of the path to it
-	int p = compiler_path.find_last_of( '/' );			// scan r -> l for first '/'
-	if ( p == -1 ) {
-		compiler_name = compiler_path;
-	} else {
-		compiler_name = *new string( compiler_path.substr( p + 1 ) );
-	} // if
-
-	if ( prefix( compiler_name, "gcc" ) ) {				// allow suffix on gcc name
-		args[nargs++] = "-no-integrated-cpp";
-		args[nargs++] = "-Wno-deprecated";
-		args[nargs++] = "-Wno-strict-aliasing";			// casting from one type to another
-		#ifdef HAVE_CAST_FUNCTION_TYPE
-		args[nargs++] = "-Wno-cast-function-type";
-		#endif // HAVE_CAST_FUNCTION_TYPE
-		if ( ! std_flag && ! x_flag ) {
-			args[nargs++] = "-std=gnu11";				// default c11, if none specified
-		} // if
-		args[nargs++] = "-D__int8_t_defined";			// prevent gcc type-size attributes
-		args[nargs++] = ( *new string( string("-B") + bprefix ) ).c_str();
-	} else {
-		cerr << argv[0] << " error, compiler \"" << compiler_name << "\" unsupported." << endl;
-		exit( EXIT_FAILURE );
-	} // if
-
-	args[nargs] = nullptr;								// terminate
-
-	#ifdef __DEBUG_H__
-	cerr << "nargs: " << nargs << endl;
-	cerr << "args:" << endl;
-	for ( int i = 0; args[i] != nullptr; i += 1 ) {
-		cerr << " \"" << args[i] << "\"" << endl;
-	} // for
-	cerr << endl;
-	#endif // __DEBUG_H__
-
-	if ( ! quiet ) {
-		cerr << "CFA " << "Version " << Version << heading << endl;
-		if ( help ) {
-			cerr <<
-				"-debug\t\t\t: use cfa runtime with debug checking" << endl <<
-				"-help\t\t\t: print this help message" << endl <<
-				"-quiet\t\t\t: print no messages from the cfa command" << endl <<
-				"-CFA\t\t\t: run the cpp preprocessor and the cfa-cpp translator" << endl <<
-				"-XCFA -cfa-cpp-flag\t: pass next flag as-is to the cfa-cpp translator" << endl <<
-				"...\t\t\t: any other " << compiler_name << " flags" << endl;
-		} // if
-	} // if
-
-	if ( verbose ) {
-		if ( argc == 2 ) exit( EXIT_SUCCESS );			// if only the -v flag is specified, do not invoke gcc
-
-		for ( int i = 0; args[i] != nullptr; i += 1 ) {
-			cerr << args[i] << " ";
-		} // for
-		cerr << endl;
-	} // if
-
-	if ( ! nonoptarg ) {
-		cerr << argv[0] << " error, no input files" << endl;
-		exit( EXIT_FAILURE );
-	} // if
-
-	// execute the command and return the result
-
-	execvp( args[0], (char * const *)args );			// should not return
-	perror( "CFA Translator error: execvp" );
+    } // if
+
+    if ( ! nonoptarg ) {
+	cerr << argv[0] << " error, no input files" << endl;
 	exit( EXIT_FAILURE );
+    } // if
+
+    // execute the command and return the result
+
+    execvp( args[0], (char *const *)args );		// should not return
+    perror( "CFA Translator error: cfa level, execvp" );
+    exit( EXIT_FAILURE );
 } // main
 
 // Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
 // compile-command: "make install" //
 // End: //
Index: driver/cpp.cc
===================================================================
--- driver/cpp.cc	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
+++ driver/cpp.cc	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
@@ -0,0 +1,376 @@
+//                              -*- Mode: C++ -*- 
+// 
+// CForall Version 1.0, Copyright (C) Peter A. Buhr 2002
+// 
+// cpp.cc -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Thu Aug 29 12:24:06 2002
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Sep 20 07:33:49 2002
+// Update Count     : 50
+// 
+
+#include <iostream>
+#include <string>
+#include <stdio.h>					// tempnam, freopen, perror
+#include <unistd.h>					// execvp, fork, unlink
+#include <sys/wait.h>					// wait
+
+#include "../config.h"					// configure info
+
+using namespace std;
+
+
+//#define __DEBUG_H__
+
+
+int main( int argc, char *argv[] ) {
+    int code;
+    int i;
+
+    string arg;
+    string bprefix;
+
+    string cpp_in;
+    string cpp_out;
+    string cpp;
+    string cpp_name( "gcc" );
+
+    bool CFA_flag = false;
+    bool cpp_flag = false;
+    bool gnu = false;
+
+    const char *args[argc + 100];			// leave space for 100 additional cfa command line values
+    int nargs = 1;					// 0 => command name
+    const char *argsCppOnly[argc];			// cpp only arguments
+    int nargsCppOnly = 0;
+    const char *argsCFAOnly[argc];			// CFA only arguments
+    int nargsCFAOnly = 0;
+
+    // get a name of a temporary file
+
+    char *tmpfile = tempnam( NULL, "CFA" );		// storage is not freed
+
+#ifdef __DEBUG_H__
+    cerr << "CPP:" << endl;
+#endif // __DEBUG_H__
+
+    // process all the arguments
+
+    for ( i = 1; i < argc; i += 1 ) {
+#ifdef __DEBUG_H__
+	cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	arg = argv[i];
+#ifdef __DEBUG_H__
+	cerr << "arg:\"" << arg << "\"" << endl;
+#endif // __DEBUG_H__
+	if ( arg.substr(0,1) == "-" ) {
+	    if ( arg == "-D__CFA__" ) {
+		CFA_flag = true;			// strip -D__CFA__ flag
+	    } else if ( arg == "-D__CPP__" ) {
+		cpp_flag = true;			// strip -D__CPP__ flag
+	    } else if ( arg.substr(0,sizeof("-D__GNU")-1) == "-D__GNU" ) {
+		gnu = true;				// strip -D__GNUxxx flags to remove duplication
+	    } else if ( arg == "-lang-c" ) {		// strip -lang-c flag
+	    } else if ( arg.substr(0,sizeof("-A")-1) == "-A" ) { // strip -A flags
+	    } else if ( arg.substr(0,sizeof("-D__STDC_HOSTED__")-1) == "-D__STDC_HOSTED__" ) { // strip this define: causes conflict
+	    } else if ( arg.substr(0,sizeof("-o")-1) == "-o" ) {
+		i += 1;					// strip -o flag and its argument
+	    } else if ( arg.substr(0,sizeof("-D__CFA_FLAG__")-1) == "-D__CFA_FLAG__" ) {
+		argsCFAOnly[nargsCFAOnly] = ( *new string( arg.substr(sizeof("-D__CFA_FLAG__")) ) ).c_str(); // pass argument along
+		nargsCFAOnly += 1;
+	    } else if ( arg == "-v" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg.substr(0,sizeof("-I")-1) == "-I" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg == "-C" || arg == "-P" || arg == "-H" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg.substr(0,sizeof("-W")-1) == "-W" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg == "-lint" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg == "-pedantic" || arg == "-pedantic-errors" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg == "-traditional" || arg == "-trigraphs" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg == "-dM" || arg == "-dD" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg == "-M" || arg == "-MG" || arg == "-MM" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg == "-MD" || arg == "-MMD" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+		i += 1;
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( arg == "-imacros" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+		i += 1;
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( arg == "-include" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+		i += 1;
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( arg == "-idirafter" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+		i += 1;
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( arg == "-iprefix" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+		i += 1;
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( arg == "-iwithprefix" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+		i += 1;
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( arg == "-isystem" ) {
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+		i += 1;
+		argsCppOnly[nargsCppOnly] = argv[i];	// pass argument along
+		nargsCppOnly += 1;
+#ifdef __DEBUG_H__
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( arg.substr(0,sizeof("-D__GCC_BPREFIX__")-1) == "-D__GCC_BPREFIX__" ) {
+		bprefix = arg.substr(sizeof("-D__GCC_BPREFIX__"));
+	    } else if ( arg.substr(0,sizeof("-D__GCC_MACHINE__")-1) == "-D__GCC_MACHINE__" ) {
+		argsCppOnly[nargsCppOnly] = "-b";	// pass argument along
+		nargsCppOnly += 1;
+		argsCppOnly[nargsCppOnly] = ( *new string(arg.substr(sizeof("-D__GCC_MACHINE__")) ) ).c_str(); // pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg.substr(0,sizeof("-D__GCC_VERSION__")-1) == "-D__GCC_VERSION__" ) {
+		argsCppOnly[nargsCppOnly] = "-V";	// pass argument along
+		nargsCppOnly += 1;
+		argsCppOnly[nargsCppOnly] = ( *new string( arg.substr(sizeof("-D__GCC_VERSION__")) ) ).c_str(); // pass argument along
+		nargsCppOnly += 1;
+	    } else if ( arg.substr(0,sizeof("-D__CPP_NAME__")-1) == "-D__CPP_NAME__" ) {
+		cpp_name = arg.substr(sizeof("-D__CPP_NAME__"));
+	    } else if ( arg.substr(1,1) != "+" ) {
+		args[nargs] = argv[i];			// pass argument along
+		nargs += 1;
+	    } // if
+	} else {
+	    if ( cpp_in.length() == 0 ) {
+		cpp_in = arg;
+#ifdef __DEBUG_H__
+		cerr << "cpp_in:\"" << cpp_in << "\"" << endl;
+#endif // __DEBUG_H__
+	    } else if ( cpp_out.length() == 0 ) {
+		cpp_out = arg;
+#ifdef __DEBUG_H__
+		cerr << "cpp_out:\"" << cpp_out << "\""<< endl;
+#endif // __DEBUG_H__
+	    } else {
+		cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
+		exit( 1 );
+	    } // if
+	} // if
+    } // for
+
+    argsCppOnly[nargsCppOnly] = "-D__cplusplus";
+    nargsCppOnly += 1;
+
+    if ( cpp_in.length() == 0 ) {
+	cerr << "Usage: " << argv[0] << " input-file [output-file] [options]" << endl;
+	exit( 1 );
+    } // if
+
+    if ( cpp_flag && CFA_flag ) {
+	cerr << argv[0] << " Error cannot use -E and -CFA flags together." << endl;
+	exit( -1 );
+    } // if
+
+    // The -E flag is specified so only run the preprocessor and output is
+    // written to standard output.
+    //
+    // OR
+    //
+    // The preprocessor is called internally during compilation, probably by
+    // "collect" during linking to compile some ctor/dtor code. In this case,
+    // the cfa-cpp preprocessor is not run.  Output is redirected to cpp_out
+
+    if ( cpp_flag || bprefix.length() == 0 ) {
+	if ( ! cpp_flag ) {
+	    if ( freopen( cpp_out.c_str(), "w", stdout ) == NULL ) { // redirect stdout if not -E
+		cerr << argv[0] << ": Error can't write to " << cpp_out << endl;
+		exit( -1 );
+	    } // if
+
+	    // If called by collect, must prevent the compiler from recursively
+	    // calling this cpp through the -B path. To stop the recursion,
+	    // sent the COMPILER_PATH environment variable to the NULL string,
+	    // which removes the -B path supplied on the initial cfa command.
+
+	    if ( gnu ) {
+		putenv( "COMPILER_PATH=" );
+	    } // if
+	} // if
+
+	if ( bprefix.length() == 0 ) {			// collect ?
+	    args[0] = "gcc";				// use gcc
+	} else {
+	    args[0] = cpp_name.c_str();
+	} // if
+	args[nargs] = "-E";
+	nargs += 1;
+
+	for ( i = 0; i < nargsCppOnly; i += 1 ) {	// copy cpp only arguments
+	    args[nargs] = argsCppOnly[i];
+	    nargs += 1;
+	} // if
+
+	args[nargs] = cpp_in.c_str();
+	nargs += 1;
+	args[nargs] = NULL;				// terminate argument list
+
+#ifdef __DEBUG_H__
+	cerr << "nargs: " << nargs << endl;
+	for ( i = 0; args[i] != NULL; i += 1 ) {
+	    cerr << args[i] << " ";
+	} // for
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	execvp( args[0], (char *const *)args );		// should not return
+	perror( "CFA translator error: cpp level, exec" );
+	exit( -1 );
+    } // if
+
+    // Run the C preprocessor and save the output in tmpfile.
+
+    if ( fork() == 0 ) {				// child process ?
+	if ( freopen( tmpfile, "w", stdout ) == NULL) {	// redirect output to tmpfile
+	    cerr << argv[0] << ": Error can't write to " << tmpfile << endl;
+	    exit( -1 );
+	} // if
+
+	args[0] = cpp_name.c_str();
+	args[nargs] = "-E";
+	nargs += 1;
+
+	for ( i = 0; i < nargsCppOnly; i += 1 ) {	// copy cpp only arguments
+	    args[nargs] = argsCppOnly[i];
+	    nargs += 1;
+	} // if
+
+	args[nargs] = cpp_in.c_str();
+	nargs += 1;
+	args[nargs] = NULL;				// terminate argument list
+
+#ifdef __DEBUG_H__
+	cerr << "cpp nargs: " << nargs << endl;
+	for ( i = 0; args[i] != NULL; i += 1 ) {
+	    cerr << args[i] << " ";
+	} // for
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	execvp( args[0], (char *const *)args );		// should not return
+	perror( "CFA translator error: cpp level, exec" );
+	exit( -1 );
+    } // if
+
+    wait( &code );					// wait for child to finish
+
+    if ( WIFSIGNALED(code) != 0 ) {			// child completed successfully ?
+	unlink( tmpfile );
+	cerr << "CFA translator error: cpp failed with signal " << WTERMSIG(code) << endl;
+	exit( -1 );
+    } // if
+
+    // If -CFA flag specified, run the cfa-cpp preprocessor on the temporary
+    // file, and output is written to standard output.  Otherwise, run the
+    // cfa-cpp preprocessor on the temporary file and save the result into the
+    // output file.
+
+    if ( fork() == 0 ) {				// child process ?
+	args[0] = ( *new string( bprefix + "/cfa-cpp" ) ).c_str();
+
+	for ( i = 0; i < nargsCFAOnly; i += 1 ) {	// copy CFA only arguments
+	    args[nargs] = argsCFAOnly[i];
+	    nargs += 1;
+	} // if
+	args[nargs] = "-p";
+	nargs += 1;
+
+	args[nargs] = tmpfile;
+	nargs += 1;
+
+	if ( ! CFA_flag ) {				// run cfa-cpp ?
+	    args[nargs] = cpp_out.c_str();
+	    nargs += 1;
+	} // if
+	args[nargs] = NULL;				// terminate argument list
+
+#ifdef __DEBUG_H__
+	cerr << "cfa-cpp nargs: " << nargs << endl;
+	for ( i = 0; args[i] != NULL; i += 1 ) {
+	    cerr << args[i] << " ";
+	} // for
+	cerr << endl;
+#endif // __DEBUG_H__
+
+	execvp( args[0], (char *const *)args );		// should not return
+	perror( "CFA translator error: cpp level, exec" );
+    } // if
+
+    wait( &code );					// wait for child to finish
+
+    unlink( tmpfile );
+
+    if ( WIFSIGNALED(code) != 0 ) {			// child completed successfully ?
+	cerr << "CFA translator error: cfa-cpp failed with signal " << WTERMSIG(code) << endl;
+	exit( -1 );
+    } // if
+
+    if ( CFA_flag ) {					// -CFA flag ?
+	exit( -1 );					// tell gcc not to go any further
+    } else {
+	exit( WEXITSTATUS(code) );
+    } // if
+} // main
+
+
+// Local Variables: //
+// compile-command: "gmake" //
+// End: //
Index: driver/test.c
===================================================================
--- driver/test.c	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
+++ driver/test.c	(revision 51b734528489f81a5af985bfee9aa3b6625b9774)
@@ -0,0 +1,2 @@
+forall( type T ) T id( T );
+int main() {}
