From 478dade09a4288f73e963b7f185ef9f73b681b42 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 18 May 2013 17:49:32 -0700 Subject: maint: port --enable-gcc-warnings to clang * configure.ac: If clang, add -Wno-format-extra-args and -Wno-tautological-constant-out-of-range-compare. * gl/lib/rand-isaac.c (ind): * gl/lib/randread.c (readisaac): * src/ls.c (dev_ino_push, dev_ino_pop): * src/sort.c (buffer_linelim): * src/system.h (is_nul): * src/tail.c (tail_forever_inotify): Rewrite to avoid casts that clang dislikes. It's good to avoid casts anyway. * src/expr.c (integer_overflow): Declare only if it exists. (die): Remove; unused. * src/ls.c (dev_ino_push): New function, replacing ... (DEV_INO_PUSH): ... this removed macro. All uses changed. (decode_switches): Rewrite "str"+i to &str[i]. --- src/tail.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/tail.c') diff --git a/src/tail.c b/src/tail.c index 6bbc7251f..0f1a37c07 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1446,6 +1446,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files, { struct File_spec *fspec; struct inotify_event *ev; + void *void_ev; /* When following by name without --retry, and the last file has been unlinked or renamed-away, diagnose it and return. */ @@ -1507,7 +1508,8 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files, error (EXIT_FAILURE, errno, _("error reading inotify event")); } - ev = (struct inotify_event *) (evbuf + evbuf_off); + void_ev = evbuf + evbuf_off; + ev = void_ev; evbuf_off += sizeof (*ev) + ev->len; if (ev->len) /* event on ev->name in watched directory */ -- cgit v1.2.3-54-g00ecf