aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorRafael Espindola <espindola@gcc.gnu.org>2009-11-19 20:22:53 +0000
committerRafael Espindola <espindola@gcc.gnu.org>2009-11-19 20:22:53 +0000
commite4d5031cc88db53fe3aa9759b9c9780c179b21b5 (patch)
treeb395448ebbfaf7f0dd42352215cbda920c328003 /gcc/doc
parentbf4967a1bd8c61fdf111a47f6ef87e24479299df (diff)
downloadgcc-e4d5031cc88db53fe3aa9759b9c9780c179b21b5.zip
gcc-e4d5031cc88db53fe3aa9759b9c9780c179b21b5.tar.gz
gcc-e4d5031cc88db53fe3aa9759b9c9780c179b21b5.tar.bz2
[multiple changes]
2009-11-19 Rafael Avila de Espindola <espindola@google.com> * g++.dg/plugin/selfassign.c: Include plugin-version.h. (plugin_init): Pass correct version to plugin_default_version_check. * gcc.dg/plugin/ggcplug.c: Include plugin-version.h. (plugin_init): Pass correct version to plugin_default_version_check. * gcc.dg/plugin/selfassign.c: Include plugin-version.h. (plugin_init): Pass correct version to plugin_default_version_check. 2009-11-19 Basile Starynkevitch <basile@starynkevitch.net> Rafael Avila de Espindola <espindola@google.com> * doc/plugins.texi (Plugin initialization): Added advices for retrieving the version of GCC at plugin compilation and loading times. From-SVN: r154342
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/plugins.texi19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi
index 6639a4e..eb1008e 100644
--- a/gcc/doc/plugins.texi
+++ b/gcc/doc/plugins.texi
@@ -105,6 +105,25 @@ The function @code{plugin_default_version_check} takes two pointers to
such structure and compare them field by field. It can be used by the
plugin's @code{plugin_init} function.
+The version of GCC used to compile the plugin can be found in the symbol
+@code{gcc_version} defined in the header @file{plugin-version.h}. The
+recommended version check to perform looks like
+
+@smallexample
+#include "plugin-version.h"
+...
+
+int
+plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+@{
+ if (!plugin_default_version_check (version, &gcc_version))
+ return 1;
+
+@}
+@end smallexample
+
+but you can also check the individual fields if you want a less strict check.
@subsection Plugin callbacks