Changes in / [ca20b07:c7616dd]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cc1.cc

    rca20b07 rc7616dd  
    1010// Created On       : Fri Aug 26 14:23:51 2005
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 11:07:22 2023
    13 // Update Count     : 427
     12// Last Modified On : Fri Jun  9 11:36:44 2023
     13// Update Count     : 423
    1414//
    1515
    1616#include <iostream>
     17using std::cerr;
     18using std::endl;
    1719#include <string>
     20using std::string;
    1821#include <algorithm>                                                                    // find
    1922#include <cstdio>                                                                               // stderr, stdout, perror, fprintf
    2023#include <cstdlib>                                                                              // getenv, exit, mkstemp
    21 using namespace std;
    2224#include <unistd.h>                                                                             // execvp, fork, unlink
    2325#include <sys/wait.h>                                                                   // wait
     
    5052        if ( dot == string::npos ) return;
    5153        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 ) {
    5355                args[nargs++] = "-x";
    5456                args[nargs++] = "c";
     
    151153
    152154        #ifdef __DEBUG_H__
    153         cerr << "#########" << endl << "Stage1 " << string( 100, '#' ) << endl << "#########" << endl;
     155        cerr << "Stage1" << endl;
    154156        #endif // __DEBUG_H__
    155157        checkEnv1();                                                                            // arguments passed via environment variables
    156158        #ifdef __DEBUG_H__
    157         cerr << string( 100, '*' ) << endl;
    158159        for ( int i = 1; i < argc; i += 1 ) {
    159160                cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
    160161        } // for
    161         cerr << string( 100, '*' ) << endl;
    162162        #endif // __DEBUG_H__
    163163
     
    260260                } else {
    261261                        args[nargs++] = "-x";
    262                         args[nargs++] = ( *new string( lang ) ).c_str();
     262                        args[nargs++] = ( *new string( lang.c_str() ) ).c_str();
    263263                } // if
    264264                args[nargs++] = cpp_in;
     
    275275                } // for
    276276                cerr << endl;
    277                 cerr << string( 100, '*' ) << endl;
    278277                #endif // __DEBUG_H__
    279278
     
    299298                } else {
    300299                        args[nargs++] = "-x";
    301                         args[nargs++] = ( *new string( lang ) ).c_str();
     300                        args[nargs++] = ( *new string( lang.c_str() ) ).c_str();
    302301                } // if
    303302                args[nargs++] = cpp_in;                                                 // input to cpp
     
    347346
    348347        #ifdef __DEBUG_H__
    349         cerr << "#########" << endl << "Stage2 " << string( 100, '#' ) << endl << "#########" << endl;
     348        cerr << "Stage2" << endl;
    350349        #endif // __DEBUG_H__
    351350        checkEnv2( cargs, ncargs );                                                     // arguments passed via environment variables
    352351        #ifdef __DEBUG_H__
    353         cerr << string( 100, '*' ) << endl;
    354352        for ( int i = 1; i < argc; i += 1 ) {
    355353                cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
    356354        } // for
    357         cerr << string( 100, '*' ) << endl;
    358355        #endif // __DEBUG_H__
    359356
     
    476473                if ( CFA_flag ) {                                                               // run cfa-cpp ?
    477474                        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();
    479476                        } // if
    480477                } else {
     
    574571int main( const int argc, const char * const argv[], __attribute__((unused)) const char * const env[] ) {
    575572        #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
    577576        #endif // __DEBUG_H__
    578577
Note: See TracChangeset for help on using the changeset viewer.