It will not fix the problem in itself, but it will make it the responsibility of the Pike codec to make sure that it produces the same entitity (i.e. the builtin werror()) as was encoded. A custom codec should not have to be 100% compatible with the Pike codec (that would be rather pointless, since then you could just use the Pike one) just to be able to encode/decode programs which depend on stuff dumped by Pike at installation.
Your "solution" would make all calls to builtins slower, I'm afraid.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2004-07-04 13:53: Subject: Re: Warnings from startup script
Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
Ideally, modules dumped by Pike should be decoded by Pike's codec, not the Roxen one. Is there no support for switching codecs when resolving dependencies?
I'm not sure that this will fix the problem.
As far as my limited understanding of the problem thus far can tell me:
- werror() appears to be a Pike builtin function.
- Therefore it compiles into a different bytecode especially reserved
for builtins.
- Therefore, dumping a module at Pike install time (because it's a Pike
lib) will cause the bytecode for builtins to be used.
- Hence, any attempt to cause werror() to be overloaded with a different
function (roxen_werror()) just by changing the load/link order will fail miserably, since it then needs an opcode that addresses a user-defined function instead of a builtin.
- But, since this is in a Pike lib, we do *not* want to have to redump the
module using a different dumper or recompile it. Pike should be able to be preinstalled on a system where you add Roxen/ChiliMoon later.
So, IMO, the simplest solution would be to do what C does to solve this: Create a _werror() which is the actual builtin, then use a normal werror() definition which simply calls _werror() in the standard lib, and allow this werror() to be overridden by roxen_werror().
Or is this a wrong/too simplistic account of situation?
Sincerely, srb@cuci.nl Stephen R. van den Berg (AKA BuGless).
"Good moaning!"
/ Brevbäraren