https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109673

--- Comment #2 from Parke <parke.nexus at gmail dot com> ---
Thank you for the explanation.

It seems to me that it would (should?) be possible for -Os to detect the
cast-to-void and therefore suppress the second warning (line 5).

It also seems to me the above change, if implemented, would be an improvement
from the user's point of view (i.e. from my point of view).

I compile my code with -Wall -Wextra and -Werror.  Consequently, in order to
get my code to compile (on Ubuntu), I have to write the following:

void * discard = getcwd ( s, sizeof s );
(void) discard;

Instead of the more readable:

(void) getcwd ( s, sizeof s );

Your thoughts?  Thanks!

Reply via email to