[cfe-dev] clang driver, how it does set the diagnostic depending on the language?

Paolo Bolzoni bolzoni at cs.unipr.it
Mon Dec 15 04:51:25 PST 2008


dear cfe-dev,

how clang (as driver) does set the diagnostic levels depending on the
language?

For example C89 sees BCPL's comments as an extension, C99 or C++ doesn't.

As other example trigraphs can be ignored:
In clang.cpp I can see
  if (Trigraphs.getPosition())
    Options.Trigraphs = Trigraphs;

Once Options.Trigraphs is set (for example to 0), how Diagnostic is alerted
of treating trigraphs as errors?



The clang.cpp 's function
bool InitializeLangOptions(LangOptions &Options, LangKind LK);
initialize the LangOptions object that keeps info about the language, but I
can't find how those settings interact with the diagnostic itself.


The function
void InitializeDiagnostics(Diagnostic &Diags);
does not touch language related issues.

I am pretty lost.

Thanks
pb



More information about the cfe-dev mailing list