Paul i just tested, compiling a source file with some inexistant directive in a source file like:
-foo_bar(init). Seems to not trigger any error or warning during compilation, at least not with r14b02 nor r13b03. On Thu, Apr 7, 2011 at 6:31 PM, Paul Davis <[email protected]> wrote: > On Thu, Apr 7, 2011 at 10:06 AM, Filipe David Manana > <[email protected]> wrote: >> Hi Matt, >> >> Thanks for the finding and the patch. >> I would prefer to return 'true' not only if we're on R13B03 but also >> if the release is older than that. >> Also, instead of using the erts version, I think it's easier to use >> the otp release, since people refer to otp versions mostly by the >> release version on not by the erts version (I might be wrong here). >> Do you agree with the following? >> >> diff --git a/src/ejson/ejson.erl b/src/ejson/ejson.erl >> index 2b26444..11f3b79 100644 >> --- a/src/ejson/ejson.erl >> +++ b/src/ejson/ejson.erl >> @@ -27,7 +27,12 @@ init() -> >> filename:join(Dir, ejson) >> end, >> (catch erlang:load_nif(SoName, 0)), >> - ok. >> + case erlang:system_info(otp_release) =< "R13B03" of >> + true -> >> + true; >> + false -> >> + ok >> + end. >> >> >> >> On Thu, Apr 7, 2011 at 2:32 PM, Matt Goodall <[email protected]> wrote: >>> Hi, >>> The new ejson module doesn't support older versions of Erlang because the >>> expected result from the module's on_load fun changed from true to ok. >>> The attached one-line change (as a git diff) fixes it for me using the >>> standard Erlang packages on Ubuntu 10.10 and 11.04 but I don't have a newer >>> version of Erlang installed to test against. >>> Obviously, with this change applied I'm still using the non-NIF json >>> implementation but at least the ejson module loads ;-). >>> - Matt >> >> >> >> -- >> Filipe David Manana, >> [email protected], [email protected] >> >> "Reasonable men adapt themselves to the world. >> Unreasonable men adapt the world to themselves. >> That's why all progress depends on unreasonable men." >> > > Also, we never bumped the minimum Erlang version requirement. I'm not > entirely sure what would happen on R12 with that -on_load even being > there. > -- Filipe David Manana, [email protected], [email protected] "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men."
