🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Deprecation warning for application-registered entities

Started by
1 comment, last by WitchLord 8 years ago

We've been using AngelScript for quite some time and had to deprecate some global variables and functions over the years. We try to keep backward compatibility, so they are still supported, but may not play nicely with newer features. However, our users who don't check our documentation for updates are often unaware of deprecation and use those entities anyway, commonly leading to bugs that they have trouble finding. Is there a way we could detect usage of such deprecated entities in a module and issue a compile-time warning?

Advertisement

My first idea would be to check the reference count of such objects and print a warning if they exceed 1 (I'm assuming that one reference is reserved for the engine).

Hmm, I can't think of an easy way for this. You could use the JIT compiler interface and go through the bytecode to see if any of the deprecated entitites are being accessed, but it would probably be much easier to modify the library to print a warning while compiling the code if the deprecated entity is accessed.

I'll add this to my to-do list as this sounds like the kind of feature that the core library would have to have.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement