[erlang-questions] Using -callback with libraries supporting R14 and higher

Anthony Molinaro <>
Tue Feb 19 17:27:51 CET 2013


Hi,

I recently was asked to add -callback support to a library I maintain
because someone was getting warnings from dialyzer.  Upon looking into
it I don't see any way to support both R14 and R15.

The -callback attribute seems to cause syntax errors with the R14 compiler.
If you include both with R15 you get an error about how you can't use them
together.

I know it's possible using a -D flag and some conditional macros, but that
requires integration with the build system (and despite its wide appeal,
rebar is not the only game in town, some people use EMakefiles, some
GNU autotools, etc).

Does OTP provide some sort of macro definition, similar to say ?MODULE
which provides the version of OTP?  If not how are other library
maintainers providing versions for multiple incompatible OTP releases?

-Anthony

-- 
------------------------------------------------------------------------
Anthony Molinaro                           <>



More information about the erlang-questions mailing list