This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFT] libffi testsuite cleanup warnings


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]