Anyone know how to make the compiler spit out a warning?

Anyone know how to make the compiler spit out a warning if something is compiled that needs one?

Like, "Yeah you can use this now, but don't do it again!"

Thanks!

-Jim lee

#warning this code is released under a CCL licensing scheme, see Source_Code_License.rtf

Yeah, that only works if the code in the library is being actively compiled. I was hoping I could get something for when an old version of a library call has been called. I'm thinking that's not going to be possible..

Thanks for the tip though.

-Jim lee

You could make an overloaded function for the library call with just the warning return in it

For a deprecated function. Put this in the Library.h file where the function is declared. The warning will only appear if the user puts that function in their code.

	[[deprecated ("May be removed in future release. See README and library examples.")]]
	int16_t oldFunction(int16_t);
1 Like

That is so cool! It does EXACTLY what I was looking for!

Thank you!

-Jim lee