diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2003-09-23 20:03:30 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2003-09-23 20:03:30 +0000 |
commit | 11f10e6b1f34001a5abd7b0046c28610b058b1ff (patch) | |
tree | 743380001d2341c199e3740ca7296f1783cef17c /libstdc++-v3/testsuite/17_intro | |
parent | 1593ad2eddcadbfcefe8ff4abecffb724d71aedb (diff) | |
download | gcc-11f10e6b1f34001a5abd7b0046c28610b058b1ff.zip gcc-11f10e6b1f34001a5abd7b0046c28610b058b1ff.tar.gz gcc-11f10e6b1f34001a5abd7b0046c28610b058b1ff.tar.bz2 |
locale_facets.tcc: Tweak to avoid warnings.
2003-09-23 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.tcc: Tweak to avoid warnings.
* testsuite/testsuite_hooks.h: Same.
* testsuite/*/*.cc: Same.
From-SVN: r71693
Diffstat (limited to 'libstdc++-v3/testsuite/17_intro')
10 files changed, 22 insertions, 141 deletions
diff --git a/libstdc++-v3/testsuite/17_intro/header_cerrno.cc b/libstdc++-v3/testsuite/17_intro/header_cerrno.cc index bfd869e..a8d19cf 100644 --- a/libstdc++-v3/testsuite/17_intro/header_cerrno.cc +++ b/libstdc++-v3/testsuite/17_intro/header_cerrno.cc @@ -1,6 +1,6 @@ // 2001-02-06 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -24,12 +24,13 @@ namespace gnu { - void test01() + int test01() { int i = errno; #ifndef errno #error "errno_must_be_a_macro" #endif + return i; } } diff --git a/libstdc++-v3/testsuite/17_intro/header_ciso646.cc b/libstdc++-v3/testsuite/17_intro/header_ciso646.cc deleted file mode 100644 index 35b1cee..0000000 --- a/libstdc++-v3/testsuite/17_intro/header_ciso646.cc +++ /dev/null @@ -1,119 +0,0 @@ -// 1999-05-20 bkoz - -// Copyright (C) 1999, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) -// any later version. - -// This library 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 library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// 17.4.1.2 Headers, ciso646 - -// { dg-do link } - -#include <ciso646> -#include <testsuite_hooks.h> - - -// 2.11 Keywords -// alternative representations -// and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, xor_eq - -// C 2.2.2 Header <iso646.h> -// The tokens (as above) are keywords and do not appear as macros in <ciso646>. - -// Test for macros. -bool test01() -{ - bool test = true; - -#if 0 - -#ifdef and - test = false; -#endif - -#ifdef and_eq - test = false; -#endif - -#ifdef bitand - test = false; -#endif - -#ifdef bitor - test = false; -#endif - -#ifdef compl - test = false; -#endif - -#ifdef not_eq - test = false; -#endif - -#ifdef not_or - test = false; -#endif - -#ifdef or - test = false; -#endif - -#ifdef or_eq - test = false; -#endif - -#ifdef xor - test = false; -#endif - -#ifdef xor_eq - test = false; -#endif - -#endif - - return test; -} - - -// Equivalance in usage. -bool test02() -{ - bool test = true; - - bool arg1 = true; - bool arg2 = false; - int int1 = 45; - int int2 = 0; - - VERIFY( arg1 && int1 ); - VERIFY( arg1 and int1 ); - - VERIFY( (arg1 && arg2) == (arg1 and arg2) ); - VERIFY( (arg1 && int1) == (arg1 and int1) ); - - return test; -} - - -int main(void) -{ - test01(); - test02(); - - return 0; -} diff --git a/libstdc++-v3/testsuite/17_intro/header_csetjmp.cc b/libstdc++-v3/testsuite/17_intro/header_csetjmp.cc index 4e2610d..1cbb630 100644 --- a/libstdc++-v3/testsuite/17_intro/header_csetjmp.cc +++ b/libstdc++-v3/testsuite/17_intro/header_csetjmp.cc @@ -1,6 +1,6 @@ // 2001-02-06 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -27,7 +27,7 @@ namespace gnu void test01() { std::jmp_buf env; - int i = setjmp(env); + int i __attribute__((unused)) = setjmp(env); #ifndef setjmp #error "setjmp_must_be_a_macro" #endif diff --git a/libstdc++-v3/testsuite/17_intro/header_cstdarg.cc b/libstdc++-v3/testsuite/17_intro/header_cstdarg.cc index 260e929..9e82930 100644 --- a/libstdc++-v3/testsuite/17_intro/header_cstdarg.cc +++ b/libstdc++-v3/testsuite/17_intro/header_cstdarg.cc @@ -1,6 +1,6 @@ // 2001-02-06 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -26,7 +26,7 @@ namespace gnu { void test01() { - std::va_list list; + std::va_list __attribute__((unused)) list; #ifndef va_arg #error "va_arg_must_be_a_macro" #endif diff --git a/libstdc++-v3/testsuite/17_intro/header_cstddef.cc b/libstdc++-v3/testsuite/17_intro/header_cstddef.cc index eab1c75..69f83f0 100644 --- a/libstdc++-v3/testsuite/17_intro/header_cstddef.cc +++ b/libstdc++-v3/testsuite/17_intro/header_cstddef.cc @@ -1,6 +1,6 @@ // 2001-02-06 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -32,7 +32,7 @@ namespace gnu void test01() { - std::size_t i = offsetof(struct test_type, i); + std::size_t i __attribute__((unused)) = offsetof(struct test_type, i); #ifndef offsetof #error "offsetof_must_be_a_macro" #endif diff --git a/libstdc++-v3/testsuite/17_intro/header_cstdio.cc b/libstdc++-v3/testsuite/17_intro/header_cstdio.cc index 383cc0a..a7be009f 100644 --- a/libstdc++-v3/testsuite/17_intro/header_cstdio.cc +++ b/libstdc++-v3/testsuite/17_intro/header_cstdio.cc @@ -1,6 +1,6 @@ // 2000-01-01 bkoz -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -25,6 +25,6 @@ int main(void) { // Make sure size_t is in namespace std - std::size_t i = 5; + std::size_t i __attribute__((unused)) = 5; return 0; } diff --git a/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc b/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc index f86f423..377bd60 100644 --- a/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc +++ b/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc @@ -1,6 +1,6 @@ // 2000-01-01 bkoz -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -25,15 +25,15 @@ // libstdc++/2190 void test01() { - long a = std::abs(1L); + long a __attribute__((unused)) = std::abs(1L); std::div(2L, 1L); - std::ldiv_t b; + std::ldiv_t b __attribute__((unused)); } void test02() { // Make sure size_t is in namespace std. - std::size_t i = 5; + std::size_t i __attribute__((unused)) = 5; } int main() diff --git a/libstdc++-v3/testsuite/17_intro/header_cstring.cc b/libstdc++-v3/testsuite/17_intro/header_cstring.cc index ae8852a..3085763 100644 --- a/libstdc++-v3/testsuite/17_intro/header_cstring.cc +++ b/libstdc++-v3/testsuite/17_intro/header_cstring.cc @@ -1,6 +1,6 @@ // 2000-01-01 bkoz -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -26,6 +26,6 @@ int main(void) { // Make sure size_t is in namespace std - std::size_t i = std::strlen("tibet shop/san francisco (415) 982-0326"); + std::size_t i __attribute__((unused)) = std::strlen("tibet shop/san francisco (415) 982-0326"); return 0; } diff --git a/libstdc++-v3/testsuite/17_intro/header_ctime.cc b/libstdc++-v3/testsuite/17_intro/header_ctime.cc index 03f8294..1b97d64 100644 --- a/libstdc++-v3/testsuite/17_intro/header_ctime.cc +++ b/libstdc++-v3/testsuite/17_intro/header_ctime.cc @@ -1,6 +1,6 @@ // 2000-01-01 bkoz -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -22,10 +22,9 @@ #include <ctime> - int main(void) { // Make sure size_t is in namespace std - std::size_t i = 5; + std::size_t i __attribute__((unused)) = 5; return 0; } diff --git a/libstdc++-v3/testsuite/17_intro/header_cwchar.cc b/libstdc++-v3/testsuite/17_intro/header_cwchar.cc index 8d65e02..dc2eefe 100644 --- a/libstdc++-v3/testsuite/17_intro/header_cwchar.cc +++ b/libstdc++-v3/testsuite/17_intro/header_cwchar.cc @@ -1,6 +1,6 @@ // 2000-01-01 bkoz -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -25,9 +25,9 @@ int main(void) { // Make sure size_t is in namespace std - std::size_t i = 5; + std::size_t i __attribute__((unused)) = 5; - std::tm mytime; + std::tm __attribute__((unused)) mytime; return 0; } |