https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109673
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Parke from comment #2) > > 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! That is PR 66425 but really you should not avoiding the return value here because getcwd will return NULL on failure as defined by POSIX.