From ee7c1553f896f5fa20feed36b7f790026cd1dc83 Mon Sep 17 00:00:00 2001 From: Avril Date: Thu, 10 Mar 2022 14:53:26 +0000 Subject: [PATCH] Fixed `REPLACE_STDERR` compiler warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for sink's current commit: Curse − 凶 --- README.md | 2 +- sink.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b30dc92..4212970 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Run `make && sudo make install` to build with full optimisations and install `si To build for debugging, run `make debug`. ### Compiler flags -`-DREPLACE_STDERR` - Add to `CFLAGS` when building a target to re-route the program's `stderr` stream to the sink as well. By default, it is closed after the other streams have been successfully rewritten. +`-DREPLACE_STDERR` - Add to `CFLAGS` when building a target to re-route the program's `stderr` stream to the sink as well. By default, it is left open. `-DNO_SEARCH_PATH` - Add to `CFLAGS` when building to prevent the program looking up its argument in the `PATH` environment variable. `-DNO_ENV` - Add to `CFLAGS` when building to prevent `envp` passthrough to the `execve()`'d program. diff --git a/sink.c b/sink.c index 6f02c6a..a5468eb 100644 --- a/sink.c +++ b/sink.c @@ -95,6 +95,7 @@ int main(int argc, char** argv, char** envp) #ifdef REPLACE_STDERR #define perror(v) ((void)(v)) +#pragma GCC diagnostic ignored "-Wunused-value" #define eprintf(...) ((void)(__VA_ARGS__)) #else #define eprintf(...) fprintf(stderr, __VA_ARGS__)