Fixed `REPLACE_STDERR` compiler warnings.

Fortune for sink's current commit: Curse − 凶
master
Avril 2 years ago
parent e1aa693e75
commit ee7c1553f8
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -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.

@ -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__)

Loading…
Cancel
Save