Changes in / [ca20b07:c7616dd]
- File:
-
- 1 edited
-
driver/cc1.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
rca20b07 rc7616dd 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 11:07:22202313 // Update Count : 42 712 // Last Modified On : Fri Jun 9 11:36:44 2023 13 // Update Count : 423 14 14 // 15 15 16 16 #include <iostream> 17 using std::cerr; 18 using std::endl; 17 19 #include <string> 20 using std::string; 18 21 #include <algorithm> // find 19 22 #include <cstdio> // stderr, stdout, perror, fprintf 20 23 #include <cstdlib> // getenv, exit, mkstemp 21 using namespace std;22 24 #include <unistd.h> // execvp, fork, unlink 23 25 #include <sys/wait.h> // wait … … 50 52 if ( dot == string::npos ) return; 51 53 const string * end = suffixes + NumSuffixes; 52 if ( find( suffixes, end, arg.substr( dot + 1 ) ) != end ) {54 if ( std::find( suffixes, end, arg.substr( dot + 1 ) ) != end ) { 53 55 args[nargs++] = "-x"; 54 56 args[nargs++] = "c"; … … 151 153 152 154 #ifdef __DEBUG_H__ 153 cerr << " #########" << endl << "Stage1 " << string( 100, '#' ) << endl << "#########" << endl;155 cerr << "Stage1" << endl; 154 156 #endif // __DEBUG_H__ 155 157 checkEnv1(); // arguments passed via environment variables 156 158 #ifdef __DEBUG_H__ 157 cerr << string( 100, '*' ) << endl;158 159 for ( int i = 1; i < argc; i += 1 ) { 159 160 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 160 161 } // for 161 cerr << string( 100, '*' ) << endl;162 162 #endif // __DEBUG_H__ 163 163 … … 260 260 } else { 261 261 args[nargs++] = "-x"; 262 args[nargs++] = ( *new string( lang ) ).c_str();262 args[nargs++] = ( *new string( lang.c_str() ) ).c_str(); 263 263 } // if 264 264 args[nargs++] = cpp_in; … … 275 275 } // for 276 276 cerr << endl; 277 cerr << string( 100, '*' ) << endl;278 277 #endif // __DEBUG_H__ 279 278 … … 299 298 } else { 300 299 args[nargs++] = "-x"; 301 args[nargs++] = ( *new string( lang ) ).c_str();300 args[nargs++] = ( *new string( lang.c_str() ) ).c_str(); 302 301 } // if 303 302 args[nargs++] = cpp_in; // input to cpp … … 347 346 348 347 #ifdef __DEBUG_H__ 349 cerr << " #########" << endl << "Stage2 " << string( 100, '#' ) << endl << "#########" << endl;348 cerr << "Stage2" << endl; 350 349 #endif // __DEBUG_H__ 351 350 checkEnv2( cargs, ncargs ); // arguments passed via environment variables 352 351 #ifdef __DEBUG_H__ 353 cerr << string( 100, '*' ) << endl;354 352 for ( int i = 1; i < argc; i += 1 ) { 355 353 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 356 354 } // for 357 cerr << string( 100, '*' ) << endl;358 355 #endif // __DEBUG_H__ 359 356 … … 476 473 if ( CFA_flag ) { // run cfa-cpp ? 477 474 if ( o_file.size() != 0 ) { // location for output 478 cargs[ncargs++] = ( *new string( o_file ) ).c_str();475 cargs[ncargs++] = ( *new string( o_file.c_str() ) ).c_str(); 479 476 } // if 480 477 } else { … … 574 571 int main( const int argc, const char * const argv[], __attribute__((unused)) const char * const env[] ) { 575 572 #ifdef __DEBUG_H__ 576 cerr << "#########" << endl << "main cc1 " << string( 100, '#' ) << endl << "#########" << endl; 573 for ( int i = 0; env[i] != nullptr; i += 1 ) { 574 cerr << env[i] << endl; 575 } // for 577 576 #endif // __DEBUG_H__ 578 577
Note:
See TracChangeset
for help on using the changeset viewer.