This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [plugins] checking the compiler version


Rafael Espindola <espindola@google.com> writes:

> The question is what to pass. BASEVER is a natural candidate, but I
> would expect most plugins to depend on more fine grained things. Any
> change to one of the structures used in tree will probably break most.

True, but the important thing for plugins to check is consistency with a
released version of gcc.  I don't think we get much benefit from adding
mechanism for structure checksums for unreleased versions.

Having the plugin provide a function which checks the supported version
is going to force the same code to be written in a bunch of plugins.  I
think we should provide an automatic version.  For example, perhaps
gcc-plugin.h could pick up the gcc version, and do something like

#ifndef PLUGIN_PROVIDES_VERSION_CHECK
bool
plugin_check_version(const char* version)
{
  return strcmp(version, PLUGIN_VERSION) == 0;
}
#endif

and then somehow arrange for that to be the callback for the version
check.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]