Studying note of GCC-3.4.6 source (20)

3.2.2. Prepare for switches handling

After creating cpp_reader, c_common_init_options confirms the language finally; and initializes related data structure. The function will return information about the language.

 

c_common_init_options (continue)

 

210    cpp_opts = cpp_get_options (parse_in);

211    cpp_opts ->dollars_in_ident = DOLLARS_IN_IDENTIFIERS;

212    cpp_opts ->objc = c_dialect_objc ();

213 

214    /* Reset to avoid warnings on internal definitions. We set it just

215      before passing on command-line options to cpplib.  */

216    cpp_opts ->warn_dollars = 0;

217 

218    flag_const_strings = c_dialect_cxx ();

219    flag_exceptions = c_dialect_cxx ();

220    warn_pointer_arith = c_dialect_cxx ();

221 

222    deferred_opts = xmalloc (argc * sizeof (struct deferred_opt));

223 

224    result = lang_flags[c_language];

225 

226    if (c_language == clk_c)

227    {

228      for (i = 1; i < argc; i++)

229      {

230        /* If preprocessing assembly language, accept any of the C-family

231          front end options since the driver may pass them through.  */

232        if (! strcmp (argv[i], "-lang-asm"))

233          result |= CL_C | CL_ObjC | CL_CXX | CL_ObjCXX;

234  #ifdef CL_F77

235        /* If potentially preprocessing Fortran we have to accept its

236          front end options since the driver may them through.  */

237        else if (! strcmp (argv[i], "-traditional-cpp"))

238        {

239          permit_fortran_options = true;

240          result |= CL_F77;

241        }

242  #endif

243      }

244    }

245    return result;

246  }

 

cpp_opts is a global variable, which points to the opts field of cpp_reader. cpp_get_options just accesses this field. c_dialect_cxx just checks if the language can support c++. Above, flag_const_strings, flag_exceptions, warn_pointer_arith, deferred_opts are all global variables. Among which, flag_const_strings, if nonzero, means given string constants the type `const char *', as mandated by the standard. flag_exceptions, if nonzero, means generate extra code for exception handling and enable exception handling. warn_pointer_arith, if nonzero, means warn about sizeof (function) or addition / subtraction of function pointers. While defer_opt holds switches parsed by c_common_handle_option, but whose handling is deferred to c_common_post_options.

 

你可能感兴趣的:(exception,function,assembly,fortran,Warnings,Constants)