office-gobmx/bin/gen-boost-headers
Stephan Bergmann 306510f085 Adapt to new Clang 15 trunk -Wdeprecated-builtins
...<0b89d1d59f>
"[Sema] Add deprecation warnings for some compiler provided __has_* type
traits", which hits in Boost include files,

> In file included from libreofficekit/qa/tilebench/tilebench.cxx:27:
> In file included from external/boost/include/boost/property_tree/json_parser.hpp:31:
> In file included from workdir/UnpackedTarball/boost/boost/property_tree/json_parser.hpp:14:
> In file included from external/boost/include/boost/property_tree/ptree.hpp:31:
> In file included from workdir/UnpackedTarball/boost/boost/property_tree/ptree.hpp:16:
> In file included from workdir/UnpackedTarball/boost/boost/property_tree/string_path.hpp:15:
> In file included from workdir/UnpackedTarball/boost/boost/property_tree/id_translator.hpp:16:
> In file included from external/boost/include/boost/optional.hpp:31:
> In file included from workdir/UnpackedTarball/boost/boost/optional.hpp:15:
> In file included from workdir/UnpackedTarball/boost/boost/optional/optional.hpp:42:
> workdir/UnpackedTarball/boost/boost/type_traits/has_nothrow_constructor.hpp:27:84: error: builtin __has_nothrow_constructor is deprecated; use __is_nothrow_constructible instead [-Werror,-Wdeprecated-builtins]
> template <class T> struct has_nothrow_constructor : public integral_constant<bool, BOOST_HAS_NOTHROW_CONSTRUCTOR(T)>{};
>                                                                                    ^
> workdir/UnpackedTarball/boost/boost/type_traits/intrinsics.hpp:199:48: note: expanded from macro 'BOOST_HAS_NOTHROW_CONSTRUCTOR'
> #     define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value)
>                                                ^

etc.

Change-Id: I08376710e25013b44279532d6e5fc256ed95cb76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137046
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-14 13:28:50 +02:00

70 lines
2.7 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# generate a bunch of dummy headers that wrap the crappy boost headers and
# suppress a myriad of warnings; requires GCC's #include_next extension
# To run this do: make cmd cmd="bin/gen-boost-headers"
set -euo pipefail
IFS=$'\n\t'
GENDIR=${SRCDIR}/external/boost/include
rm -rf ${GENDIR}
mkdir ${GENDIR}
# note: clucene contains a copy of half of boost, so ignore it too
# note: firebird contains a copy of half of boost, so ignore it too
cat <(cd ${SRCDIR} && git grep -h '^# *include') \
<(find ${WORKDIR}/UnpackedTarball/ -mindepth 1 -maxdepth 1 -type d \
| grep -v boost \
| grep -v clucene \
| grep -v firebird \
| xargs grep -hr '^# *include') \
| grep -o '\bboost.*\.\(h\|hpp\|ipp\)' \
| sort | uniq \
| while read -r HEADER; do
mkdir -p "$(dirname ${GENDIR}/${HEADER})"
cat > "${GENDIR}/${HEADER}" << _EOF
/* generated by $0, do not edit! */
#pragma once
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */
#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
#pragma GCC diagnostic ignored "-Wdeprecated-builtins"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor"
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#pragma GCC diagnostic ignored "-Winvalid-constexpr"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend"
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#pragma GCC diagnostic ignored "-Wnonnull"
#pragma GCC diagnostic ignored "-Wparentheses"
#pragma GCC diagnostic ignored "-Wplacement-new"
#pragma GCC diagnostic ignored "-Wreturn-type"
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
#pragma GCC diagnostic ignored "-Wtype-limits"
#pragma GCC diagnostic ignored "-Wundef"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-macros"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-variable"
#include_next <${HEADER}>
#pragma GCC diagnostic pop
_EOF
done