18.4.0 released Sep 25, 2023
Unused var

Purpose: Prevent compiler error if variable is not used.

unused-var <variable name>

unused-var prevents C compiler from erroring out if <variable name> is unused. Generally, you don't want to have unused variables - they typically indicate errors or clutter. However, in some cases you might need such variables as a reminder for a future enhancement, or for some other reason it is unavoidable. In any case, you can use unused-var to shield such instances from causing errors.
In the following, variable "bw" is created and the number of bytes written is stored in it. Such variable is not used at the moment, however if you would use it in the future and want to keep it, use unused-var to prevent compiler errors:
pf-out bytes-written define bw "Hi %s\n", "world"
unused-var bw

See also
See all

You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a link back to this page (dofollow) - see full license at CC-BY-4.0. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind.