This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [plugins] checking the compiler version
- From: Ian Lance Taylor <iant at google dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 08 Apr 2009 08:36:37 -0700
- Subject: Re: [plugins] checking the compiler version
- References: <38a0d8450904080756o23ec5744vd95f5599ebf2aff7@mail.gmail.com>
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