At Fri, 5 Jul 2024 10:03:05 -0400 (EDT), Mouse <[email protected]> 
wrote:
Subject: Re: compilers and unused args in functions
>
> One is
>
>       (void)arg;

This is, in my opinion, the one correct way to explicitly and with
intent "use" an otherwise unused variable or parameter.

It is after all idiomatic C when used with more complex expressions,
such as function calls.

Here "arg" is a valid expression, and a "(void)" cast discards or
ignores the result of an expression.

The abstraction of __USE() seems unnecessary and more difficult to read.

--
                                        Greg A. Woods <[email protected]>

Kelowna, BC     +1 250 762-7675           RoboHack <[email protected]>
Planix, Inc. <[email protected]>     Avoncote Farms <[email protected]>

Attachment: pgpfRscm28euy.pgp
Description: OpenPGP Digital Signature

Reply via email to