OSDN Git Service

2006-02-28 Andreas Tobler <a.tobler@schweiz.ch>
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Feb 2006 23:12:00 +0000 (23:12 +0000)
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Feb 2006 23:12:00 +0000 (23:12 +0000)
* testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for
-O2, -O3, -Os and the warning flags -W -Wall.
* testsuite/libffi.special/special.exp: Likewise.
* testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark
unused parameter unused for gcc or else do nothing.
* testsuite/libffi.special/ffitestcxx.h: Likewise.
* testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif
and userdata unused.
* testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise.
* testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise.
* testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise.
* testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise.
* testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise.
* testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise.
* testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise.
* testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise.
* testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise.
* testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise.
* testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise.
* testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise.
* testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise.
* testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise.
* testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise.
* testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise.
* testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise.
* testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise.
* testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise.
* testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise.
* testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise.
* testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise.
* testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise.
* testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast
void* to avoid compiler warning.
(main): Likewise.
(cls_struct_align_gn): Mark cif and userdata unused.
* testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn):
Likewise.
* testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise.
* testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise.
* testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and
data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and
data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif
and data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and
data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and
data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif
and data unused.
(main): Cast res_call to silence gcc.
* testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and
userdata unused.
(cls_ret_schar_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and
userdata unused.
(cls_ret_sint_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and
userdata unused.
(cls_ret_sshort_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn):  Mark cif and
userdata unused.
(cls_ret_uchar_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and
userdata unused.
(cls_ret_uint_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif
and userdata unused.
* testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and
userdata unused.
(cls_ret_ushort_fn): Cast printf parameter to silence gcc.
* testsuite/libffi.call/float.c (floating): Remove unused parameter e.
* testsuite/libffi.call/float1.c (main): Remove unused variable i.
Cleanup white spaces.
* testsuite/libffi.call/negint.c (checking): Remove unused variable i.
* testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark
cif and userdata unused.
* testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn):
Likewise.
* testsuite/libffi.call/nested_struct10.c (B_gn): Likewise.
* testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf
formatters to silence gcc.
(B_gn): Mark cif and userdata unused.
* testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata
unused.
* testsuite/libffi.call/nested_struct4.c: Mention related PR.
(B_gn): Mark cif and userdata unused.
* testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata
unused.
* testsuite/libffi.call/nested_struct6.c: Mention related PR.
(B_gn): Mark cif and userdata unused.
* testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata
unused.
* testsuite/libffi.call/nested_struct8.c (B_gn): Likewise.
* testsuite/libffi.call/nested_struct9.c (B_gn): Likewise.
* testsuite/libffi.call/problem1.c (stub): Likewise.
* testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence
gcc.
* testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned
in the last commit for this test case in the test case itself.
* testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as
unused.
* testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise.
* testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise.
* testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise.
* testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise.
* testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise.
* testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111582 138bc75d-0d04-0410-961f-82ee72b054a4

75 files changed:
libffi/ChangeLog
libffi/testsuite/libffi.call/call.exp
libffi/testsuite/libffi.call/closure_fn0.c
libffi/testsuite/libffi.call/closure_fn1.c
libffi/testsuite/libffi.call/closure_fn2.c
libffi/testsuite/libffi.call/closure_fn3.c
libffi/testsuite/libffi.call/closure_fn4.c
libffi/testsuite/libffi.call/closure_fn5.c
libffi/testsuite/libffi.call/closure_fn6.c
libffi/testsuite/libffi.call/cls_12byte.c
libffi/testsuite/libffi.call/cls_16byte.c
libffi/testsuite/libffi.call/cls_18byte.c
libffi/testsuite/libffi.call/cls_19byte.c
libffi/testsuite/libffi.call/cls_1_1byte.c
libffi/testsuite/libffi.call/cls_20byte.c
libffi/testsuite/libffi.call/cls_20byte1.c
libffi/testsuite/libffi.call/cls_24byte.c
libffi/testsuite/libffi.call/cls_2byte.c
libffi/testsuite/libffi.call/cls_3_1byte.c
libffi/testsuite/libffi.call/cls_3byte1.c
libffi/testsuite/libffi.call/cls_3byte2.c
libffi/testsuite/libffi.call/cls_4_1byte.c
libffi/testsuite/libffi.call/cls_4byte.c
libffi/testsuite/libffi.call/cls_5_1_byte.c
libffi/testsuite/libffi.call/cls_5byte.c
libffi/testsuite/libffi.call/cls_64byte.c
libffi/testsuite/libffi.call/cls_6_1_byte.c
libffi/testsuite/libffi.call/cls_6byte.c
libffi/testsuite/libffi.call/cls_7_1_byte.c
libffi/testsuite/libffi.call/cls_7byte.c
libffi/testsuite/libffi.call/cls_8byte.c
libffi/testsuite/libffi.call/cls_9byte1.c
libffi/testsuite/libffi.call/cls_9byte2.c
libffi/testsuite/libffi.call/cls_align_double.c
libffi/testsuite/libffi.call/cls_align_float.c
libffi/testsuite/libffi.call/cls_align_longdouble.c
libffi/testsuite/libffi.call/cls_align_pointer.c
libffi/testsuite/libffi.call/cls_align_sint16.c
libffi/testsuite/libffi.call/cls_align_sint32.c
libffi/testsuite/libffi.call/cls_align_sint64.c
libffi/testsuite/libffi.call/cls_align_uint16.c
libffi/testsuite/libffi.call/cls_align_uint32.c
libffi/testsuite/libffi.call/cls_double.c
libffi/testsuite/libffi.call/cls_float.c
libffi/testsuite/libffi.call/cls_multi_schar.c
libffi/testsuite/libffi.call/cls_multi_sshort.c
libffi/testsuite/libffi.call/cls_multi_sshortchar.c
libffi/testsuite/libffi.call/cls_multi_uchar.c
libffi/testsuite/libffi.call/cls_multi_ushort.c
libffi/testsuite/libffi.call/cls_multi_ushortchar.c
libffi/testsuite/libffi.call/cls_schar.c
libffi/testsuite/libffi.call/cls_sint.c
libffi/testsuite/libffi.call/cls_sshort.c
libffi/testsuite/libffi.call/cls_uchar.c
libffi/testsuite/libffi.call/cls_uint.c
libffi/testsuite/libffi.call/cls_ulonglong.c
libffi/testsuite/libffi.call/cls_ushort.c
libffi/testsuite/libffi.call/ffitest.h
libffi/testsuite/libffi.call/float.c
libffi/testsuite/libffi.call/float1.c
libffi/testsuite/libffi.call/negint.c
libffi/testsuite/libffi.call/nested_struct.c
libffi/testsuite/libffi.call/nested_struct1.c
libffi/testsuite/libffi.call/nested_struct10.c
libffi/testsuite/libffi.call/nested_struct2.c
libffi/testsuite/libffi.call/nested_struct3.c
libffi/testsuite/libffi.call/nested_struct4.c
libffi/testsuite/libffi.call/nested_struct5.c
libffi/testsuite/libffi.call/nested_struct6.c
libffi/testsuite/libffi.call/nested_struct7.c
libffi/testsuite/libffi.call/nested_struct8.c
libffi/testsuite/libffi.call/nested_struct9.c
libffi/testsuite/libffi.call/problem1.c
libffi/testsuite/libffi.call/pyobjc-tc.c
libffi/testsuite/libffi.call/return_fl2.c

index bee6c57..ebe638f 100644 (file)
@@ -1,3 +1,134 @@
+2006-02-28  Andreas Tobler  <a.tobler@schweiz.ch>
+
+       * testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for
+       -O2, -O3, -Os and the warning flags -W -Wall.
+       * testsuite/libffi.special/special.exp: Likewise.
+       * testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark
+       unused parameter unused for gcc or else do nothing.
+       * testsuite/libffi.special/ffitestcxx.h: Likewise.
+       * testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif
+       and userdata unused.
+       * testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise.
+       * testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise.
+       * testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise.
+       * testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise.
+       * testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise.
+       * testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise.
+       * testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise.
+       * testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise.
+       * testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise.
+       * testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise.
+       * testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise.
+       * testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise.
+       * testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise.
+       * testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise.
+       * testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise.
+       * testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise.
+       * testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise.
+       * testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise.
+       * testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise.
+       * testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise.
+       * testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise.
+       * testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise.
+       * testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise.
+       * testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn):
+       Likewise.
+       * testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn):
+       Likewise.
+       * testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn):
+       Likewise.
+       * testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast
+       void* to avoid compiler warning.
+       (main): Likewise.
+       (cls_struct_align_gn): Mark cif and userdata unused.
+       * testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn):
+       Likewise.
+       * testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn):
+       Likewise.
+       * testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn):
+       Likewise.
+       * testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn):
+       Likewise.
+       * testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn):
+       Likewise.
+       * testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise.
+       * testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise.
+       * testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and
+       data unused.
+       (main): Cast res_call to silence gcc.
+       * testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and
+       data unused.
+       (main): Cast res_call to silence gcc.
+       * testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif
+       and data unused.
+       (main): Cast res_call to silence gcc.
+       * testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and
+       data unused.
+       (main): Cast res_call to silence gcc.
+       * testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and
+       data unused.
+       (main): Cast res_call to silence gcc.
+       * testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif
+       and data unused.
+       (main): Cast res_call to silence gcc.
+       * testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and
+       userdata unused.
+       (cls_ret_schar_fn): Cast printf parameter to silence gcc.
+       * testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and
+       userdata unused.
+       (cls_ret_sint_fn): Cast printf parameter to silence gcc.
+       * testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and
+       userdata unused.
+       (cls_ret_sshort_fn): Cast printf parameter to silence gcc.
+       * testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn):  Mark cif and
+       userdata unused.
+       (cls_ret_uchar_fn): Cast printf parameter to silence gcc.
+       * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and
+       userdata unused.
+       (cls_ret_uint_fn): Cast printf parameter to silence gcc.
+       * testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif
+       and userdata unused.
+       * testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and
+       userdata unused.
+       (cls_ret_ushort_fn): Cast printf parameter to silence gcc.
+       * testsuite/libffi.call/float.c (floating): Remove unused parameter e.
+       * testsuite/libffi.call/float1.c (main): Remove unused variable i.
+       Cleanup white spaces.
+       * testsuite/libffi.call/negint.c (checking): Remove unused variable i.
+       * testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark
+       cif and userdata unused.
+       * testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn):
+       Likewise.
+       * testsuite/libffi.call/nested_struct10.c (B_gn): Likewise.
+       * testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf
+       formatters to silence gcc.
+       (B_gn): Mark cif and userdata unused.
+       * testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata
+       unused.
+       * testsuite/libffi.call/nested_struct4.c: Mention related PR.
+       (B_gn): Mark cif and userdata unused.
+       * testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata
+       unused.
+       * testsuite/libffi.call/nested_struct6.c: Mention related PR.
+       (B_gn): Mark cif and userdata unused.
+       * testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata
+       unused.
+       * testsuite/libffi.call/nested_struct8.c (B_gn): Likewise.
+       * testsuite/libffi.call/nested_struct9.c (B_gn): Likewise.
+       * testsuite/libffi.call/problem1.c (stub): Likewise.
+       * testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence
+       gcc.
+       * testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned
+       in the last commit for this test case in the test case itself.
+       * testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as
+       unused.
+       * testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise.
+       * testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise.
+       * testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise.
+       * testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise.
+       * testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise.
+       * testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise.
+
 2006-02-22  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * src/sh/sysv.S: Fix register numbers in the FDE for
index 3b0bd32..bd4d2e8 100644 (file)
@@ -1,18 +1,18 @@
-#   Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006 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
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 # libffi testsuite that uses the 'dg.exp' driver.
 
@@ -23,7 +23,10 @@ libffi-init
 
 global srcdir subdir
 
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "" 
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" ""
 
 dg-finish
 
index 13209c2..baa0a31 100644 (file)
@@ -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 __UNUSED__, void* resp, void** args,
+                void* userdata)
 {
   *(ffi_arg*)resp =
     (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
index ab3b165..89988aa 100644 (file)
@@ -10,7 +10,7 @@
 #include "ffitest.h"
 
 
-static void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
+static void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
                             void* userdata)
 {
   *(ffi_arg*)resp =
index 5a61099..f46fdce 100644 (file)
@@ -9,7 +9,7 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void closure_test_fn2(ffi_cif* cif,void* resp,void** args,
+static void closure_test_fn2(ffi_cif* cif __UNUSED__, void* resp, void** args,
                             void* userdata)
 {
   *(ffi_arg*)resp =
index 42bd44c..acfef78 100644 (file)
@@ -9,7 +9,7 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void closure_test_fn3(ffi_cif* cif,void* resp,void** args,
+static void closure_test_fn3(ffi_cif* cif __UNUSED__, void* resp, void** args,
                             void* userdata)
  {
    *(ffi_arg*)resp =
index 2eec222..e46b457 100644 (file)
@@ -11,7 +11,8 @@
 #include "ffitest.h"
 
 static void
-closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
+closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                void* userdata)
 {
   *(ffi_arg*)resp =
     (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
index 1151393..ea52dde 100644 (file)
@@ -7,11 +7,11 @@
    Originator: <andreast@gcc.gnu.org> 20031026  */
 
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
-
 #include "ffitest.h"
 
 static void
-closure_test_fn5(ffi_cif* cif,void* resp,void** args, void* userdata)
+closure_test_fn5(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                void* userdata)
 {
   *(ffi_arg*)resp =
     (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
index 8f8f743..c81509d 100644 (file)
@@ -9,7 +9,8 @@
 #include "ffitest.h"
 
 static void
-closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
+closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                void* userdata)
 {
   *(ffi_arg*)resp =
     (int)*(unsigned long long *)args[0] +
index a0b4c75..75269a9 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1,
   return result;
 }
 
-static void cls_struct_12byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+static void cls_struct_12byte_gn(ffi_cif* cif __UNUSED__, void* resp,
+                                void** args , void* userdata __UNUSED__)
 {
   struct cls_struct_12byte b1, b2;
 
index b40018a..09c2826 100644 (file)
@@ -29,7 +29,8 @@ cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1,
   return result;
 }
 
-static void cls_struct_16byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+static void cls_struct_16byte_gn(ffi_cif* cif __UNUSED__, void* resp,
+                                void** args, void* userdata __UNUSED__)
 {
   struct cls_struct_16byte b1, b2;
 
index d04d8b3..b465559 100644 (file)
@@ -33,7 +33,8 @@ cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1,
 }
 
 static void
-cls_struct_18byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_18byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                    void* userdata __UNUSED__)
 {
   struct cls_struct_18byte a1, a2;
 
index 1f08da1..05bf901 100644 (file)
@@ -36,7 +36,8 @@ cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1,
 }
 
 static void
-cls_struct_19byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_19byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                    void* userdata __UNUSED__)
 {
   struct cls_struct_19byte a1, a2;
 
index 4b64d92..e3fd7b6 100644 (file)
@@ -26,7 +26,8 @@ cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1,
 }
 
 static void
-cls_struct_1_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_1_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                     void* userdata __UNUSED__)
 {
 
   struct cls_struct_1_1byte a1, a2;
index 0a33b11..e75faf5 100644 (file)
@@ -29,7 +29,8 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
 }
 
 static void
-cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                    void* userdata __UNUSED__)
 {
   struct cls_struct_20byte a1, a2;
 
index c10a85c..41c1d37 100644 (file)
@@ -29,7 +29,8 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
 }
 
 static void
-cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                    void* userdata __UNUSED__)
 {
   struct cls_struct_20byte a1, a2;
 
index 6a0a530..ae6c416 100644 (file)
@@ -38,7 +38,8 @@ cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
 }
 
 static void
-cls_struct_24byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_24byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                    void* userdata __UNUSED__)
 {
   struct cls_struct_24byte b0, b1, b2, b3;
 
index 267dbc1..b9fd21e 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1,
 }
 
 static void
-cls_struct_2byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_2byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_2byte a1, a2;
index b8a475b..0feb11e 100644 (file)
@@ -32,7 +32,8 @@ cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1,
 }
 
 static void
-cls_struct_3_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_3_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                     void* userdata __UNUSED__)
 {
 
   struct cls_struct_3_1byte a1, a2;
index e5a2820..5be4e4a 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1,
 }
 
 static void
-cls_struct_3byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_3byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_3byte a1, a2;
index 356def9..c4d57d6 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1,
 }
 
 static void
-cls_struct_3byte_gn1(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_3byte_gn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                    void* userdata __UNUSED__)
 {
 
   struct cls_struct_3byte_1 a1, a2;
index c4970ce..a8a7314 100644 (file)
@@ -34,7 +34,8 @@ cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1,
 }
 
 static void
-cls_struct_4_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_4_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                     void* userdata __UNUSED__)
 {
 
   struct cls_struct_4_1byte a1, a2;
index d4f2198..073bea9 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1,
 }
 
 static void
-cls_struct_4byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_4byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_4byte a1, a2;
index e047168..776ffc2 100644 (file)
@@ -36,7 +36,8 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
 }
 
 static void
-cls_struct_5byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_5byte a1, a2;
index 14e3c83..86e9777 100644 (file)
@@ -31,7 +31,8 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
 }
 
 static void
-cls_struct_5byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_5byte a1, a2;
index fed6412..ab14590 100644 (file)
@@ -43,7 +43,8 @@ cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0,
 }
 
 static void
-cls_struct_64byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_64byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                    void* userdata __UNUSED__)
 {
   struct cls_struct_64byte b0, b1, b2, b3;
 
index 22c575d..4a42cf9 100644 (file)
@@ -38,7 +38,8 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
 }
 
 static void
-cls_struct_6byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_6byte a1, a2;
index 149eddd..1ea2630 100644 (file)
@@ -33,7 +33,8 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
 }
 
 static void
-cls_struct_6byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_6byte a1, a2;
index 43df487..1c6d4ad 100644 (file)
@@ -40,7 +40,8 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
 }
 
 static void
-cls_struct_7byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_7byte a1, a2;
index fff800e..df444f3 100644 (file)
@@ -33,7 +33,8 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
 }
 
 static void
-cls_struct_7byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_7byte a1, a2;
index 8992687..5843b0a 100644 (file)
@@ -27,7 +27,8 @@ cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1,
 }
 
 static void
-cls_struct_8byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_8byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_8byte a1, a2;
index daff5d0..334f57e 100644 (file)
@@ -29,8 +29,8 @@ cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
   return result;
 }
 
-static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args,
-                               void* userdata)
+static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
+                               void** args, void* userdata __UNUSED__)
 {
   struct cls_struct_9byte b1, b2;
 
index de4c674..0e1d01a 100644 (file)
@@ -29,8 +29,8 @@ cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
   return result;
 }
 
-static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args,
-                               void* userdata)
+static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
+                               void** args, void* userdata __UNUSED__)
 {
   struct cls_struct_9byte b1, b2;
 
index 35a0a76..f293d55 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
index d97863e..37556c8 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
index bcfddf5..506cfda 100644 (file)
@@ -29,7 +29,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
index 0041fcc..50273d9 100644 (file)
@@ -19,16 +19,19 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
   struct cls_struct_align result;
 
   result.a = a1.a + a2.a;
-  result.b = (void *)((size_t)a1.b + (size_t)a2.b);
+  result.b = (void *)((unsigned long)a1.b + (unsigned long)a2.b);
   result.c = a1.c + a2.c;
 
-  printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, (size_t)a1.b, a1.c, a2.a, (size_t)a2.b, a2.c, result.a, (size_t)result.b, result.c);
+  printf("%d %lu %d %d %lu %d: %d %lu %d\n", a1.a, (unsigned long)a1.b, a1.c,
+        a2.a, (unsigned long)a2.b, a2.c, result.a, (unsigned long)result.b,
+        result.c);
 
-  return  result;
+  return result;
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
@@ -84,14 +87,14 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
   /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
-  printf("res: %d %d %d\n", res_dbl.a, (size_t)res_dbl.b, res_dbl.c);
+  printf("res: %d %lu %d\n", res_dbl.a, (unsigned long)res_dbl.b, res_dbl.c);
   /* { dg-output "\nres: 13 14271 140" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
 
   res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
   /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
-  printf("res: %d %d %d\n", res_dbl.a, (size_t)res_dbl.b, res_dbl.c);
+  printf("res: %d %lu %d\n", res_dbl.a, (unsigned long)res_dbl.b, res_dbl.c);
   /* { dg-output "\nres: 13 14271 140" } */
 
   exit(0);
index 144c891..b71eb3f 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
index c16654e..c28a9d2 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
index 40ef6c4..e629610 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
index 6df9625..e467e37 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
index 15b7558..bdee674 100644 (file)
@@ -28,7 +28,8 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
 }
 
 static void
-cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                   void* userdata __UNUSED__)
 {
 
   struct cls_struct_align a1, a2;
index be320d2..42444a0 100644 (file)
@@ -7,8 +7,8 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_double_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
+static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                             void* userdata __UNUSED__)
  {
    *(double *)resp = *(double *)args[0];
 
index 41ce4ba..504e799 100644 (file)
@@ -7,8 +7,8 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_float_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
+static void cls_ret_float_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                            void* userdata __UNUSED__)
  {
    *(float *)resp = *(float *)args[0];
 
index 31a66fb..0ccb380 100644 (file)
@@ -19,7 +19,8 @@ signed char test_func_fn(signed char a1, signed char a2)
 
 }
 
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+                        void *data __UNUSED__)
 {
   signed char a1, a2;
 
@@ -67,7 +68,7 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
   /* { dg-output "2 125: 127" } */
-  printf("res: %d\n", res_call);
+  printf("res: %d\n", (signed char)res_call);
   /* { dg-output "\nres: 127" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL)  == FFI_OK);
index 8b4b554..9759854 100644 (file)
@@ -19,7 +19,8 @@ signed short test_func_fn(signed short a1, signed short a2)
 
 }
 
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+                        void *data __UNUSED__)
 {
   signed short a1, a2;
 
@@ -67,7 +68,7 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
   /* { dg-output "2 32765: 32767" } */
-  printf("res: %d\n", res_call);
+  printf("res: %d\n", (unsigned short)res_call);
   /* { dg-output "\nres: 32767" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL)  == FFI_OK);
index 223b10f..efd109f 100644 (file)
@@ -20,7 +20,8 @@ signed short test_func_fn(signed char a1, signed short a2,
 
 }
 
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+                        void *data __UNUSED__)
 {
   signed char a1, a3;
   signed short a2, a4;
@@ -79,7 +80,7 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
   /* { dg-output "1 32765 127 -128: 32765" } */
-  printf("res: %d\n", res_call);
+  printf("res: %d\n", (signed short)res_call);
   /* { dg-output "\nres: 32765" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL)  == FFI_OK);
index 8cf574b..855ea9c 100644 (file)
@@ -20,7 +20,8 @@ unsigned char test_func_fn(unsigned char a1, unsigned char a2,
 
 }
 
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+                        void *data __UNUSED__)
 {
   unsigned char a1, a2, a3, a4;
 
@@ -35,7 +36,9 @@ static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
 
 typedef unsigned char (*test_type)(unsigned char, unsigned char,
                                   unsigned char, unsigned char);
-void test_func(ffi_cif *cif, void *rval, void **avals, void *data)
+
+void test_func(ffi_cif *cif __UNUSED__, void *rval __UNUSED__, void **avals,
+              void *data __UNUSED__)
 {
   printf("%d %d %d %d\n", *(unsigned char *)avals[0],
         *(unsigned char *)avals[1], *(unsigned char *)avals[2],
@@ -82,7 +85,7 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
   /* { dg-output "1 2 127 125: 255" } */
-  printf("res: %d\n", res_call);
+  printf("res: %d\n", (unsigned char)res_call);
   /* { dg-output "\nres: 255" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL)  == FFI_OK);
index 6549884..e8bcf84 100644 (file)
@@ -19,7 +19,8 @@ unsigned short test_func_fn(unsigned short a1, unsigned short a2)
 
 }
 
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+                        void *data __UNUSED__)
 {
   unsigned short a1, a2;
 
@@ -67,7 +68,7 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
   /* { dg-output "2 32765: 32767" } */
-  printf("res: %d\n", res_call);
+  printf("res: %d\n", (unsigned short)res_call);
   /* { dg-output "\nres: 32767" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL)  == FFI_OK);
index 3379eed..463038d 100644 (file)
@@ -20,7 +20,8 @@ unsigned short test_func_fn(unsigned char a1, unsigned short a2,
 
 }
 
-static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
+                        void *data __UNUSED__)
 {
   unsigned char a1, a3;
   unsigned short a2, a4;
@@ -79,7 +80,7 @@ int main (void)
 
   ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
   /* { dg-output "1 2 127 128: 258" } */
-  printf("res: %d\n", res_call);
+  printf("res: %d\n", (unsigned short)res_call);
   /* { dg-output "\nres: 258" } */
 
   CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL)  == FFI_OK);
index 30292ea..beceb74 100644 (file)
@@ -7,12 +7,12 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_schar_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
+static void cls_ret_schar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                            void* userdata __UNUSED__)
 {
   *(ffi_arg*)resp = *(signed char *)args[0];
   printf("%d: %d\n",*(signed char *)args[0],
-        *(ffi_arg*)resp);
+        (int)*(ffi_arg *)(resp));
 }
 typedef signed char (*cls_ret_schar)(signed char);
 
index 9998137..462d395 100644 (file)
@@ -7,12 +7,12 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_sint_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
+static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                           void* userdata __UNUSED__)
 {
   *(ffi_arg*)resp = *(signed int *)args[0];
   printf("%d: %d\n",*(signed int *)args[0],
-        *(ffi_arg*)resp);
+        (int)*(ffi_arg *)(resp));
 }
 typedef signed int (*cls_ret_sint)(signed int);
 
index 319c67b..e676c26 100644 (file)
@@ -7,12 +7,12 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_sshort_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
+static void cls_ret_sshort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                             void* userdata __UNUSED__)
 {
   *(ffi_arg*)resp = *(signed short *)args[0];
   printf("%d: %d\n",*(signed short *)args[0],
-        *(ffi_arg*)resp);
+        (int)*(ffi_arg *)(resp));
 }
 typedef signed short (*cls_ret_sshort)(signed short);
 
index 1ea4665..d35cd09 100644 (file)
@@ -7,12 +7,12 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_uchar_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
+static void cls_ret_uchar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                            void* userdata __UNUSED__)
 {
   *(ffi_arg*)resp = *(unsigned char *)args[0];
   printf("%d: %d\n",*(unsigned char *)args[0],
-        *(ffi_arg*)resp);
+        (int)*(ffi_arg *)(resp));
 }
 typedef unsigned char (*cls_ret_uchar)(unsigned char);
 
index 5344175..25dfedf 100644 (file)
@@ -7,14 +7,14 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_uint_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
- {
-   *(ffi_arg *)resp = *(unsigned int *)args[0];
-
-   printf("%d: %d\n",*(unsigned int *)args[0],
-         *(ffi_arg *)resp);
- }
+static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                           void* userdata __UNUSED__)
+{
+  *(ffi_arg *)resp = *(unsigned int *)args[0];
+
+  printf("%d: %d\n",*(unsigned int *)args[0],
+        (int)*(ffi_arg *)(resp));
+}
 typedef unsigned int (*cls_ret_uint)(unsigned int);
 
 int main (void)
index bf866b8..f7014b7 100644 (file)
@@ -7,14 +7,14 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_ulonglong_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
- {
-   *(unsigned long long *)resp=  *(unsigned long long *)args[0];
-
-   printf("%llu: %llu\n",*(unsigned long long *)args[0],
-         *(unsigned long long *)resp);
- }
+static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
+                                void** args, void* userdata __UNUSED__)
+{
+  *(unsigned long long *)resp=  *(unsigned long long *)args[0];
+
+  printf("%llu: %llu\n",*(unsigned long long *)args[0],
+        *(unsigned long long *)(resp));
+}
 typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
 
 int main (void)
index dfc0fac..0ddfa12 100644 (file)
@@ -7,14 +7,14 @@
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
 #include "ffitest.h"
 
-static void cls_ret_ushort_fn(ffi_cif* cif,void* resp,void** args,
-                            void* userdata)
- {
-   *(ffi_arg*)resp = *(unsigned short *)args[0];
-
-   printf("%d: %d\n",*(unsigned short *)args[0],
-         *(ffi_arg*)resp);
- }
+static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                             void* userdata __UNUSED__)
+{
+  *(ffi_arg*)resp = *(unsigned short *)args[0];
+
+  printf("%d: %d\n",*(unsigned short *)args[0],
+        (int)*(ffi_arg *)(resp));
+}
 typedef unsigned short (*cls_ret_ushort)(unsigned short);
 
 int main (void)
index 45c0564..42fce04 100644 (file)
 #endif
 #endif
 
+/* Define __UNUSED__ that also other compilers than gcc can run the tests.  */
+#undef __UNUSED__
+#if defined(__GNUC__)
+#define __UNUSED__ __attribute__((__unused__))
+#else
+#define __UNUSED__
+#endif
+
 /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
    file open.  */
 #ifdef HAVE_MMAP_ANON
index 51cb2fa..fbc272d 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "ffitest.h"
 
-static int floating(int a, float b, double c, long double d, int e)
+static int floating(int a, float b, double c, long double d)
 {
   int i;
 
@@ -28,7 +28,6 @@ int main (void)
   signed int si1;
   double d;
   long double ld;
-  signed int si2;
 
   args[0] = &ffi_type_sint;
   values[0] = &si1;
@@ -38,26 +37,23 @@ int main (void)
   values[2] = &d;
   args[3] = &ffi_type_longdouble;
   values[3] = &ld;
-  args[4] = &ffi_type_sint;
-  values[4] = &si2;
 
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 5,
+  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
                     &ffi_type_sint, args) == FFI_OK);
 
   si1 = 6;
   f = 3.14159;
   d = (double)1.0/(double)3.0;
   ld = 2.71828182846L;
-  si2 = 10;
 
-  floating (si1, f, d, ld, si2);
+  floating (si1, f, d, ld);
 
   ffi_call(&cif, FFI_FN(floating), &rint, values);
 
-  printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld, si2));
+  printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld));
 
-  CHECK(rint == floating(si1, f, d, ld, si2));
+  CHECK((int)rint == floating(si1, f, d, ld));
 
   exit (0);
 }
index fb81d7d..991d059 100644 (file)
@@ -28,25 +28,25 @@ int main (void)
   void *values[MAX_ARGS];
   float f;
   value_type result[2];
-  int i;
+  unsigned int i;
 
   args[0] = &ffi_type_float;
   values[0] = &f;
-  
+
   /* Initialize the cif */
-  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
+  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
                     &ffi_type_double, args) == FFI_OK);
-  
+
   f = 3.14159;
-  
+
   /* Put a canary in the return array.  This is a regression test for
      a buffer overrun.  */
   memset(result[1].c, CANARY, sizeof (double));
 
   ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
-  
+
   /* These are not always the same!! Check for a reasonable delta */
+
   CHECK(result[0].d - dblit(f) < DBL_EPSILON);
 
   /* Check the canary.  */
index 1c8ed61..3168113 100644 (file)
@@ -11,7 +11,6 @@
 
 static int checking(int a, short b, signed char c)
 {
-  int i;
 
   return (a < 0 && b < 0 && c < 0);
 }
index 0b9da70..8b5b6a7 100644 (file)
@@ -50,7 +50,8 @@ cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
 }
 
 static void
-cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                      void* userdata __UNUSED__)
 {
   struct cls_struct_16byte1 b0;
   struct cls_struct_16byte2 b1;
index f6aefcb..29bd440 100644 (file)
@@ -52,7 +52,8 @@ cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
 }
 
 static void
-cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+                      void* userdata __UNUSED__)
 {
   struct cls_struct_16byte1 b0;
   struct cls_struct_16byte2 b1;
index 37897d0..a9f5974 100644 (file)
@@ -41,8 +41,8 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
 }
 
 static void
-B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
-     void* userdata __attribute__((unused)))
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index 2972422..a57d799 100644 (file)
@@ -27,14 +27,15 @@ B B_fn(struct A b0, struct B b1)
   result.x.b = b0.b + b1.x.b + b1.y;
   result.y = b0.b + b1.x.b;
 
-  printf("%d %d %d %d %d: %d %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y,
+  printf("%lu %d %lu %d %d: %lu %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y,
         result.x.a, result.x.b, result.y);
 
   return result;
 }
 
 static void
-B_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index bb6b9d3..1362f83 100644 (file)
@@ -35,7 +35,8 @@ B B_fn(struct A b0, struct B b1)
 }
 
 static void
-B_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index 22fd450..d7abf69 100644 (file)
@@ -3,7 +3,7 @@
                Contains structs as parameter of the struct itself.
                Sample taken from Alan Modras patch to src/prep_cif.c.
    Limitations:        none.
-   PR:         none.
+   PR:         PR 25630.
    Originator: <andreast@gcc.gnu.org> 20051010  */
 
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* powerpc*-*-darwin* } } */
@@ -35,8 +35,8 @@ static B B_fn(struct A b2, struct B b3)
 }
 
 static void
-B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
-     void* userdata __attribute__((unused)))
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index 79d67ee..07821b4 100644 (file)
@@ -35,8 +35,8 @@ static B B_fn(struct A b2, struct B b3)
 }
 
 static void
-B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
-     void* userdata __attribute__((unused)))
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index 883d2b7..1162547 100644 (file)
@@ -3,7 +3,7 @@
                Contains structs as parameter of the struct itself.
                Sample taken from Alan Modras patch to src/prep_cif.c.
    Limitations:        none.
-   PR:         none.
+   PR:         PR 25630.
    Originator: <andreast@gcc.gnu.org> 20051010  */
 
 /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* powerpc*-*-darwin* } } */
@@ -40,8 +40,8 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
 }
 
 static void
-B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
-     void* userdata __attribute__((unused)))
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index fa745de..6e7de9e 100644 (file)
@@ -35,8 +35,8 @@ static B B_fn(struct A b2, struct B b3)
 }
 
 static void
-B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
-     void* userdata __attribute__((unused)))
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index 5c231de..1f745a0 100644 (file)
@@ -40,8 +40,8 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
 }
 
 static void
-B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
-     void* userdata __attribute__((unused)))
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index 4a3e9e3..94636b5 100644 (file)
@@ -40,8 +40,8 @@ static B B_fn(struct A b2, struct B b3, struct C b4)
 }
 
 static void
-B_gn(ffi_cif* cif __attribute__((unused)), void* resp, void** args,
-     void* userdata __attribute__((unused)))
+B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+     void* userdata __UNUSED__)
 {
   struct A b0;
   struct B b1;
index 46c88db..724ffad 100644 (file)
@@ -27,7 +27,8 @@ my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2)
   return result;
 }
 
-void stub(ffi_cif* cif, void* resp, void** args, void* userdata)
+void stub(ffi_cif* cif __UNUSED__, void* resp, void** args,
+         void* userdata __UNUSED__)
 {
   struct my_ffi_struct a1;
   struct my_ffi_struct a2;
index 017323c..e29bd6c 100644 (file)
@@ -107,7 +107,7 @@ int main(void)
 
        ffi_call(&cif, FFI_FN(doit), &result, values);
 
-       printf ("The result is %d\n", result);
+       printf ("The result is %d\n", (int)result);
 
        }
        exit(0);
index 59b2d73..6df5b54 100644 (file)
@@ -7,6 +7,9 @@
 /* { dg-do run } */
 #include "ffitest.h"
 
+/* To avoid a false negative on ix86 do not declare the return_fl static.
+   See PR323.
+*/
 float return_fl(float fl1, float fl2, float fl3, float fl4)
 {
   return fl1 + fl2 + fl3 + fl4;