bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

test-ignore-value.c warnings


From: Bruno Haible
Subject: test-ignore-value.c warnings
Date: Sun, 13 Mar 2011 20:57:30 +0100
User-agent: KMail/1.9.9

Hi Eric,

On OpenBSD 4.4, which uses a gcc version 3.3.5, I get these warnings:

test-ignore-value.c:35: warning: `__warn_unused_result__' attribute directive 
ignored
test-ignore-value.c:36: warning: `__warn_unused_result__' attribute directive 
ignored
test-ignore-value.c:37: warning: `__warn_unused_result__' attribute directive 
ignored
test-ignore-value.c:38: warning: `__warn_unused_result__' attribute directive 
ignored
test-ignore-value.c:39: warning: `__warn_unused_result__' attribute directive 
ignored

The reason is that __warn_unused_result__ was introduced in gcc 3.4, not
in gcc 3.1, as the code appears to assume. OK to fix this?


2011-03-13  Bruno Haible  <address@hidden>

        ignore-value tests: Avoid warnings.
        * tests/test-ignore-value.c (_GL_ATTRIBUTE_RETURN_CHECK): Define to
        empty for gcc < 3.4.

--- tests/test-ignore-value.c.orig      Sun Mar 13 20:55:04 2011
+++ tests/test-ignore-value.c   Sun Mar 13 20:50:28 2011
@@ -24,7 +24,7 @@
 #include <stdio.h>
 
 #ifndef _GL_ATTRIBUTE_RETURN_CHECK
-# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
+# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
 #  define _GL_ATTRIBUTE_RETURN_CHECK
 # else
 #  define _GL_ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))

-- 
In memoriam Odette Sansom <http://en.wikipedia.org/wiki/Odette_Hallowes>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]