Changes in src/driver/cfa.cc [157d094:6bfe5cc]
- File:
-
- 1 edited
-
src/driver/cfa.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/driver/cfa.cc
r157d094 r6bfe5cc 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 14 14:16:33201813 // Update Count : 24412 // Last Modified On : Mon Feb 5 22:05:28 2018 13 // Update Count : 166 14 14 // 15 15 … … 19 19 #include <unistd.h> // execvp 20 20 #include <string> // STL version 21 #include <string.h> // strcmp 22 23 #include "Common/SemanticError.h" 21 24 22 #include "config.h" // configure info 25 23 … … 158 156 args[nargs] = argv[i]; // pass the argument along 159 157 nargs += 1; 160 } else if ( prefix( arg, "-std=" ) || prefix( arg, "--std=" )) {158 } else if ( prefix( arg, "-std=" ) ) { 161 159 std_flag = true; // -std=XX provided 162 160 args[nargs] = argv[i]; // pass the argument along 163 161 nargs += 1; 164 } else if ( arg == "-x" ) { // lost so force along165 args[nargs] = argv[i]; // pass the argument along166 nargs += 1;167 i += 1; // advance to argument168 args[nargs] = argv[i]; // pass the argument along169 nargs += 1;170 args[nargs] = ( *new string( string("-D__GCC_X__=") + argv[i] ) ).c_str(); // add the argument for -x171 nargs += 1;172 } else if ( prefix( arg, "-x" ) ) { // lost so force along173 args[nargs] = argv[i]; // pass the argument along174 nargs += 1;175 args[nargs] = ( *new string( string("-D__GCC_X__=") + arg.substr(2) ) ).c_str(); // add the argument for -x176 nargs += 1;177 } else if ( arg == "-w" ) {178 args[nargs] = argv[i]; // pass the argument along179 nargs += 1;180 args[nargs] = ( *new string( string("-D__CFA_FLAG__=") + arg ) ).c_str(); // add the argument for cfa-cpp181 nargs += 1;182 } else if ( prefix( arg, "-W" ) ) { // check before next tests183 if ( arg == "-Werror" || arg == "-Wall" ) {184 args[nargs] = argv[i]; // pass the argument along185 nargs += 1;186 args[nargs] = ( *new string( string("-D__CFA_FLAG__=") + arg ) ).c_str(); // add the argument for cfa-cpp187 nargs += 1;188 } else {189 unsigned int adv = prefix( arg, "-Wno-" ) ? 5 : 2;190 args[nargs] = argv[i]; // conditionally pass the argument along191 const char * warning = argv[i] + adv; // extract warning192 if ( SemanticWarning_Exist( warning ) ) { // replace the argument for cfa-cpp193 args[nargs] = ( *new string( string("-D__CFA_FLAG__=") + arg ) ).c_str();194 } // if195 nargs += 1;196 } // if197 162 } else if ( prefix( arg, "-B" ) ) { 198 163 Bprefix = arg.substr(2); // strip the -B flag … … 253 218 } // for 254 219 255 #ifdef __x86_64__256 args[nargs] = "-mcx16"; // allow double-wide CAA257 nargs += 1;258 #endif // __x86_64__259 260 220 #ifdef __DEBUG_H__ 261 221 cerr << "args:"; … … 286 246 if ( link ) { 287 247 #if ! defined(HAVE_LIBCFA_RELEASE) 288 if ( !debug ) {289 cerr << "error: Option -nodebug is unavailable, libcfa was not installed." << endl;248 if( !debug ) { 249 cerr << "error: Option -nodebug is not available, libcfa was not installed." << endl; 290 250 exit( EXIT_FAILURE ); 291 } // if251 } 292 252 #endif 293 253 #if ! defined(HAVE_LIBCFA_DEBUG) 294 if ( debug ) {295 cerr << "error: Option -debug is unavailable, libcfa-d was not installed." << endl;254 if( debug ) { 255 cerr << "error: Option -debug is not available, libcfa-d was not installed." << endl; 296 256 exit( EXIT_FAILURE ); 297 } // if257 } 298 258 #endif 299 259 … … 310 270 args[nargs] = "-L" CFA_LIBDIR; 311 271 nargs += 1; 312 if ( debug ) {272 if( debug ) { 313 273 args[nargs] = "-lcfa-d"; 314 274 } else { 315 275 args[nargs] = "-lcfa"; 316 } // if276 } 317 277 nargs += 1; 318 278 args[nargs] = "-lpthread"; … … 395 355 args[nargs] = "-Wno-deprecated"; 396 356 nargs += 1; 397 if ( ! std_flag ) { // default c 11, if none specified398 args[nargs] = "-std=gnu 11";357 if ( ! std_flag ) { // default c99, if none specified 358 args[nargs] = "-std=gnu99"; 399 359 nargs += 1; 400 360 } // if
Note:
See TracChangeset
for help on using the changeset viewer.