This is the mail archive of the
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: <firstname.lastname@example.org>
Rafael Espindola <email@example.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
plugin_check_version(const char* version)
return strcmp(version, PLUGIN_VERSION) == 0;
and then somehow arrange for that to be the callback for the version