Fix compilation with -Werror=unused-result #3676
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Compile-tested only.
~ $ /usr/local/bin/c++ -DFMT_SHARED -DSPDLOG_FMT_EXTERNAL -I/home/build/libmamba/include -isystem /usr/share -fPIC -O3 -DNDEBUG -std=gnu++17 -Wall -Wextra -Wshado w -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion - Wformat=2 -Wunreachable-code -Wuninitialized -Werror -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wuseless-cast -MD -MT micromam ba/CMakeFiles/micromamba.dir/src/constructor.cpp.o -MF micromamba/CMakeFiles/micromamba.dir/src/constructor.cpp.o.d -o micromamba/CMakeFiles/micromamba.dir/src/co nstructor.cpp.o -c /home/build/micromamba/src/constructor.cpp /home/build/micromamba/src/constructor.cpp: In function 'void read_binary_from_stdin_and_write_to_file(mamba::fs::u8path&)': /home/build/micromamba/src/constructor.cpp:200:17: error: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Werror=unused-result]
200 | std::freopen(nullptr, "rb", stdin);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~