Changeset bdd516a for driver/cpp.cc
- Timestamp:
- Apr 28, 2015, 4:21:36 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 42e2ad7
- Parents:
- ad17ba6a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cpp.cc
rad17ba6a rbdd516a 8 8 // Created On : Thu Aug 29 12:24:06 2002 9 9 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Sat Dec 6 08:31:49 201411 // Update Count : 5 110 // Last Modified On : Tue Apr 21 07:23:38 2015 11 // Update Count : 52 12 12 // 13 13 … … 218 218 if ( cpp_flag && CFA_flag ) { 219 219 cerr << argv[0] << " Error cannot use -E and -CFA flags together." << endl; 220 exit( -1);220 exit( EXIT_FAILURE ); 221 221 } // if 222 222 … … 234 234 if ( freopen( cpp_out.c_str(), "w", stdout ) == NULL ) { // redirect stdout if not -E 235 235 cerr << argv[0] << ": Error can't write to " << cpp_out << endl; 236 exit( -1);236 exit( EXIT_FAILURE ); 237 237 } // if 238 238 … … 274 274 execvp( args[0], (char *const *)args ); // should not return 275 275 perror( "CFA translator error: cpp level, exec" ); 276 exit( -1);276 exit( EXIT_FAILURE ); 277 277 } // if 278 278 … … 282 282 if ( freopen( tmpfile, "w", stdout ) == NULL) { // redirect output to tmpfile 283 283 cerr << argv[0] << ": Error can't write to " << tmpfile << endl; 284 exit( -1);284 exit( EXIT_FAILURE ); 285 285 } // if 286 286 … … 308 308 execvp( args[0], (char *const *)args ); // should not return 309 309 perror( "CFA translator error: cpp level, exec" ); 310 exit( -1);310 exit( EXIT_FAILURE ); 311 311 } // if 312 312 … … 316 316 unlink( tmpfile ); 317 317 cerr << "CFA translator error: cpp failed with signal " << WTERMSIG(code) << endl; 318 exit( -1);318 exit( EXIT_FAILURE ); 319 319 } // if 320 320 … … 357 357 wait( &code ); // wait for child to finish 358 358 359 unlink( tmpfile ); 359 if ( unlink( tmpfile ) == -1 ) { 360 cerr << "CFA translator error: cfa-cpp failed " << errno << " to remove temporary file \"" << tmpfile << "\"" << endl; 361 exit( EXIT_FAILURE ); 362 } // if 360 363 361 364 if ( WIFSIGNALED(code) != 0 ) { // child completed successfully ? 362 365 cerr << "CFA translator error: cfa-cpp failed with signal " << WTERMSIG(code) << endl; 363 exit( -1);366 exit( EXIT_FAILURE ); 364 367 } // if 365 368 366 369 if ( CFA_flag ) { // -CFA flag ? 367 exit( -1 );// tell gcc not to go any further370 exit( EXIT_FAILURE ); // tell gcc not to go any further 368 371 } else { 369 372 exit( WEXITSTATUS(code) );
Note: See TracChangeset
for help on using the changeset viewer.