[cfe-dev] GCC compatibility layer going too far?

Ludovic Courtès ludovic.courtes at inria.fr
Thu Jan 19 06:32:54 PST 2012


A project I work on produces a GCC plug-in.  A ‘configure’ macro aims to
check whether GCC is being used, and whether it supports plug-ins:


Despite being fairly elaborate, the macro returns “yes” for Clang 3.1.
However, Clang isn’t able to actually compile the plug-in, because there
are several GNU extensions used in GCC’s headers and in the plug-in
itself that are not supported (such as nested functions.)

One of the reasons why the feature test passes is that
‘clang -print-file-name=plugin’ returns GCC’s (!) header directory.

What do you think of having Clang error out instead, or perhaps return
the path to LLVM’s headers?


More information about the cfe-dev mailing list