Basile Starynkevitch <bas...@starynkevitch.net> writes: > Do we have a programmatical way to access configuration information from > inside plugins? (and not only version information)
The configuration arguments, and the version number, are passed to the plugin in struct plugin_gcc_version. > The scenario I am considering wants to detect any -even small- change to > the compiler (since I suppose a plugin is storing some data -e.g. in a > database- about the compiled file, and retrieving the same data later. > It should be "certain" that the compiler is exactly the same). I think it would be fairly difficult to construct a case where a plugin cared about the exact compiler, rather than the exact version and configuration. The only reason that the PCH support cares about the exact compiler is that it more or less takes a memory dump of the allocated GC memory. Even a small change in the set of global variables or the definition of a struct will make the memory dump invalid. It's hard for me to imagine a plugin which could or should operate in that manner. > In MELT I am just implementing the following precise trick: That seems like a fine trick. Note that it would not be sufficient for the PCH support. And I think it's overkill for the average plugin. Note that struct plugin_gcc_version gives you the configuration and the exact version number. The exact version number for an unreleased compiler gives you the date of the sources. So if you verify those strings, it's fairly unlikely that your plugin will have any trouble. Ian