adrianlopezroche / fdupes

FDUPES is a program for identifying or deleting duplicate files residing within specified directories.
2.43k stars 187 forks source link

freopen() should omit the assignment #121

Closed thiagostahlschmidt closed 5 years ago

thiagostahlschmidt commented 5 years ago

freopen() is attempting to assign its result to stdin, which is not guaranteed to be assignable: "error: assignment of read-only variable 'stdin'"

jbruchon commented 5 years ago

I remember looking into this a long time ago. One of the main (only?) reasons fdupes fails to compile on macOS is this statement, because there stdin isn't an assignable lvalue. It seems this incorrect usage is also a common mistake. See this SO answer for details: https://stackoverflow.com/a/586416