vapier      15/08/05 07:33:31

  Modified:             Makefile uname-test.c
  Log:
  fix build failures when using -Werror

Revision  Changes    Path
1.4                  src/patchsets/coreutils/uname-test/Makefile

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/uname-test/Makefile?rev=1.4&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/uname-test/Makefile?rev=1.4&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/uname-test/Makefile?r1=1.3&r2=1.4

Index: Makefile
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/coreutils/uname-test/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Makefile    5 Aug 2015 07:12:14 -0000       1.3
+++ Makefile    5 Aug 2015 07:33:31 -0000       1.4
@@ -1,4 +1,4 @@
-CFLAGS += -Wall
+CFLAGS += -Wall -Wextra -Werror
 
 all: check
 



1.15                 src/patchsets/coreutils/uname-test/uname-test.c

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/uname-test/uname-test.c?rev=1.15&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/uname-test/uname-test.c?rev=1.15&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/uname-test/uname-test.c?r1=1.14&r2=1.15

Index: uname-test.c
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/coreutils/uname-test/uname-test.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- uname-test.c        5 Aug 2015 07:31:10 -0000       1.14
+++ uname-test.c        5 Aug 2015 07:33:31 -0000       1.15
@@ -20,6 +20,9 @@
 # define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 #endif
 
+/* Ignore gcc return value warning.  */
+#define ignore_value(x) do { if (x) {;} } while (0)
+
 bool verbose = false;
 
 #define USE_PROCINFO
@@ -94,8 +97,8 @@
                                 * length limit caused us to read right up to 
the
                                 * newline ... doing "%*[^\n]\n" wont eat the 
newline
                                 */
-                               fscanf (fp, "%*[^\n]");
-                               fscanf (fp, "\n");
+                               ignore_value (fscanf (fp, "%*[^\n]"));
+                               ignore_value (fscanf (fp, "\n"));
                        }
                }
                fclose (fp);




Reply via email to