This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFT] libffi testsuite cleanup warnings
- From: Andreas Tobler <toa at pop dot agri dot ch>
- To: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Java Patches <java-patches at gcc dot gnu dot org>
- Date: Mon, 27 Feb 2006 19:18:18 +0100
- Subject: Re: [RFT] libffi testsuite cleanup warnings
- References: <4400D882.7040101@pop.agri.ch> <yddoe0tc7bs.fsf@manam.TechFak.Uni-Bielefeld.DE>
Rainer Orth wrote:
Andreas Tobler <toa@pop.agri.ch> writes:
2006-02-25 Andreas Tobler <a.tobler@schweiz.ch>
* testsuite/libffi.call/closure_fn0.c: Clean up warnings discovered by
-W -Wall.
I think it would be much more useful to describe the actual changes here
instead of how you discovered that they are necessary/useful.
Well, I can do that. I was just lazy commenting most of my own bugs.
[2 ffi_test_warn2.diff <text/plain>]
Index: testsuite/libffi.call/closure_fn0.c
===================================================================
--- testsuite/libffi.call/closure_fn0.c (revision 111437)
+++ testsuite/libffi.call/closure_fn0.c (working copy)
@@ -10,7 +10,8 @@
#include "ffitest.h"
static void
-closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
+closure_test_fn0(ffi_cif* cif __attribute__ ((unused)), void* resp, void** args,
+ void* userdata)
{
*(ffi_arg*)resp =
(int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
It may be useful to use some macro that expands to __attribte__ ((unused))
when using GCC here instead of hardcoding it directly: libffi used to be
usable with non-GCC compilers (I think there's a PR open to restore this
ability in the GCC copy), and I'd appreciate if it remained that way (or at
least doesn't become less so if it's avoidable).
I was not aware of the fact that we can/should build libffi with non-GCC.
Sure I can add something like this:
#undef __UNUSED__
#if defined(__GNUC__)
#define __UNUSED__ __attribute__((__unused__))
#else
#define __UNUSED__
#endif
Andreas