From c417817a8575731e1e10ddf063d25d9c4cdde12a Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Fri, 14 Sep 2007 17:46:56 +0000 Subject: [PATCH] all_pedantic_errors.cc: New. 2007-09-14 Benjamin Kosnik * testsuite/17_intro/headers/all_pedantic_errors.cc: New. * include/tr1_impl/cinttypes: Add pragma GCC system_header. * include/tr1_impl/cfenv: Same. * include/tr1_impl/cstdint: Same. * include/tr1/cstdbool: Same. * include/ext/pb_ds/detail/resize_policy/ hash_prime_size_policy_imp.hpp: Same. * include/parallel/partial_sum.h: Avoid VLA error with __builtin_alloca. From-SVN: r128500 --- libstdc++-v3/ChangeLog | 12 ++ .../hash_prime_size_policy_imp.hpp | 2 + libstdc++-v3/include/parallel/partial_sum.h | 3 +- libstdc++-v3/include/tr1/cstdbool | 2 + libstdc++-v3/include/tr1_impl/cfenv | 2 + libstdc++-v3/include/tr1_impl/cinttypes | 2 + libstdc++-v3/include/tr1_impl/cstdint | 2 + .../17_intro/headers/all_pedantic_errors.cc | 146 ++++++++++++++++++ 8 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 libstdc++-v3/testsuite/17_intro/headers/all_pedantic_errors.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f37831027c4..3dcfc2115e6 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2007-09-14 Benjamin Kosnik + + * testsuite/17_intro/headers/all_pedantic_errors.cc: New. + * include/tr1_impl/cinttypes: Add pragma GCC system_header. + * include/tr1_impl/cfenv: Same. + * include/tr1_impl/cstdint: Same. + * include/tr1/cstdbool: Same. + * include/ext/pb_ds/detail/resize_policy/ + hash_prime_size_policy_imp.hpp: Same. + * include/parallel/partial_sum.h: Avoid VLA error with + __builtin_alloca. + 2007-09-14 Thiemo Seufer * crossconfig.m4 (mips*-sde-elf*): New stanza. diff --git a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp index 3328c9158ac..97052cef03c 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp @@ -44,6 +44,8 @@ * Contains a resize size policy implementation. */ +#pragma GCC system_header + namespace detail { enum diff --git a/libstdc++-v3/include/parallel/partial_sum.h b/libstdc++-v3/include/parallel/partial_sum.h index 909b171d6f4..422f2537e86 100644 --- a/libstdc++-v3/include/parallel/partial_sum.h +++ b/libstdc++-v3/include/parallel/partial_sum.h @@ -39,7 +39,6 @@ #ifndef _GLIBCXX_PARALLEL_PARTIAL_SUM_H #define _GLIBCXX_PARALLEL_PARTIAL_SUM_H 1 - #include #include #include @@ -104,7 +103,7 @@ namespace __gnu_parallel return parallel_partial_sum_basecase(begin + 1, end, result + 1, bin_op, *begin); } - difference_type borders[num_threads + 2]; + difference_type* borders = __builtin_alloca(sizeof(difference_type) * (num_threads + 2)); if (Settings::partial_sum_dilatation == 1.0f) equally_split(n, num_threads + 1, borders); diff --git a/libstdc++-v3/include/tr1/cstdbool b/libstdc++-v3/include/tr1/cstdbool index 4e43db3064b..5f6e80eae9e 100644 --- a/libstdc++-v3/include/tr1/cstdbool +++ b/libstdc++-v3/include/tr1/cstdbool @@ -34,6 +34,8 @@ #ifndef _GLIBCXX_TR1_CSTDBOOL #define _GLIBCXX_TR1_CSTDBOOL 1 +#pragma GCC system_header + #include #if _GLIBCXX_HAVE_STDBOOL_H diff --git a/libstdc++-v3/include/tr1_impl/cfenv b/libstdc++-v3/include/tr1_impl/cfenv index 01535e07c30..4a1eca99d4a 100644 --- a/libstdc++-v3/include/tr1_impl/cfenv +++ b/libstdc++-v3/include/tr1_impl/cfenv @@ -32,6 +32,8 @@ * You should not attempt to use it directly. */ +#pragma GCC system_header + #if _GLIBCXX_USE_C99_FENV_TR1 #include_next diff --git a/libstdc++-v3/include/tr1_impl/cinttypes b/libstdc++-v3/include/tr1_impl/cinttypes index 05b52517626..17625931100 100644 --- a/libstdc++-v3/include/tr1_impl/cinttypes +++ b/libstdc++-v3/include/tr1_impl/cinttypes @@ -32,6 +32,8 @@ * You should not attempt to use it directly. */ +#pragma GCC system_header + #if _GLIBCXX_USE_C99_INTTYPES_TR1 // For 8.11.1/1 (see C99, Note 184) diff --git a/libstdc++-v3/include/tr1_impl/cstdint b/libstdc++-v3/include/tr1_impl/cstdint index 862ee97864b..6df74c761cb 100644 --- a/libstdc++-v3/include/tr1_impl/cstdint +++ b/libstdc++-v3/include/tr1_impl/cstdint @@ -32,6 +32,8 @@ * You should not attempt to use it directly. */ +#pragma GCC system_header + #if _GLIBCXX_USE_C99_STDINT_TR1 // For 8.22.1/1 (see C99, Notes 219, 220, 222) diff --git a/libstdc++-v3/testsuite/17_intro/headers/all_pedantic_errors.cc b/libstdc++-v3/testsuite/17_intro/headers/all_pedantic_errors.cc new file mode 100644 index 00000000000..1325cc9d366 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/all_pedantic_errors.cc @@ -0,0 +1,146 @@ +// { dg-do compile } +// { dg-options "-pedantic-errors" } + +// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// Make sure all the includes can be compiled with -Wc++0x-compat +// libstdc++/30571 + +// C +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// TR1 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Extensions +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include