News:

Let's find out together what makes a PIC Tick!

Main Menu

Suggestion for new feature

Started by kcsl, Mar 15, 2025, 04:22 PM

Previous topic - Next topic

kcsl

I have a lot of debugging code in my program, and I really appreciate that the compiler automatically removes unused procedures. However, I think it would be incredibly useful to have a way to mark certain procedures as temporary—essentially for debugging purposes.

For example, something like:
DECLARE PROCEDURE_TEMPORARY = DebugProcedure2

Now when the compiler encounters the line DebugProcedure2("hello world"), it could automatically remove it. At the final compilation stage, it would also remove the DebugProcedure2 procedure itself as there are now no references to it.

I know I could wrap all debugging statements in $ifdef DEBUGGING ... $endif, but with hundreds of them, that becomes quite cumbersome and ugly looking. A built-in way to flag and remove debugging procedures would be a great quality-of-life improvement.
It means I could also very quickly switch between the production and debug version of the code making it much easier - great for when I need to performance test without all the debug code getting in the way.

Just a thought.

Regards,
Joe
There's no room for optimism in software or hardware engineering.