From 7d435e3a09e60f2eba6ec7eb4c2d8ae4ccd0ed8a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 17 Oct 2010 22:15:52 +0200 Subject: [PATCH] nl_langinfo tests: Silence some warnings. * tests/test-nl_langinfo.c: Silence -Wtype-limits warnings. Reported by Jim Meyering. --- ChangeLog | 6 ++++++ tests/test-nl_langinfo.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ae5d49ab3..c59d85f5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-10-17 Bruno Haible + nl_langinfo tests: Silence some warnings. + * tests/test-nl_langinfo.c: Silence -Wtype-limits warnings. + Reported by Jim Meyering. + +2010-10-17 Bruno Haible + Make use of GCC's attribute __alloc_size__. * lib/xalloc.h (ATTRIBUTE_ALLOC_SIZE): New macro. (xmalloc, xzalloc, xcalloc, xrealloc, xmemdup, xnmalloc, xnrealloc, diff --git a/tests/test-nl_langinfo.c b/tests/test-nl_langinfo.c index ec89b3f75..27b1ed668 100644 --- a/tests/test-nl_langinfo.c +++ b/tests/test-nl_langinfo.c @@ -1,5 +1,5 @@ /* Test of nl_langinfo replacement. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,13 @@ SIGNATURE_CHECK (nl_langinfo, char *, (nl_item)); #include "c-strcase.h" #include "macros.h" +/* For GCC >= 4.2, silence the warnings + "comparison of unsigned expression >= 0 is always true" + in this file. */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) +# pragma GCC diagnostic ignored "-Wtype-limits" +#endif + int main (int argc, char *argv[]) { -- 2.11.0