Commit 9c1eaa17 authored by Mark Adler's avatar Mark Adler

Improve compatibility for cross-platform testing.

Avoid warning for ignoring chown() return value on some glibc's,
and change compiler from cc to gcc. Sometimes the (void) before
chown() is not sufficient to signal the programmer's intent to
ignore the return value. (Thank you return-value police.) This
commit kills that gcc warning just for copymeta(). Using pragma
then required ignoring a warning for versions of gcc that don't
recognize it (when using -Wall). Finally, gcc is used instead of
cc for platforms that don't make that equivalency.
parent 57864e60
CC=cc
CFLAGS=-O3 -Wall -Wextra
CC=gcc
CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas
LDFLAGS=
LIBS=-lm -lpthread -lz
ZOPFLI=zopfli/src/zopfli/
......
......@@ -3574,6 +3574,9 @@ local char *justname(char *path) {
return p == NULL ? path : p + 1;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
// Copy file attributes, from -> to, as best we can. This is best effort, so no
// errors are reported. The mode bits, including suid, sgid, and the sticky bit
// are copied (if allowed), the owner's user id and group id are copied (again
......@@ -3600,6 +3603,8 @@ local void copymeta(char *from, char *to) {
(void)utimes(to, times);
}
#pragma GCC diagnostic pop
// Set the access and modify times of fd to t.
local void touch(char *path, time_t t) {
struct timeval times[2];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment