office-gobmx/bin/gen-boost-headers
Michael Stahl 6c4721da4f boost: disable -Wmaybe-uninitialized from GCC 9.2.1 -Og
This warning is notorious for false positives so let's disable it here.

from sal/cppunittester/cppunittester.cxx:61:
workdir/UnpackedTarball/boost/boost/function/function_template.hpp: In function ‘SequenceSequenceT& boost::algorithm::iter_split(SequenceSequenceT&, RangeT&&, FinderT) [with SequenceSequenceT = std::__debug::vector<std::__cxx11::basic_string<char> >; RangeT = const char*&; FinderT = boost::algorithm::detail::token_finderF<boost::algorithm::detail::is_any_ofF<char> >]’:
workdir/UnpackedTarball/boost/boost/function/function_template.hpp:904:22: error: ‘*((void*)&<anonymous> +8)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  904 |           std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer));

Change-Id: Id3cf9fae8db190337b6a3eb0c847c019394088ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89349
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-24 19:15:16 +01:00

67 lines
2.5 KiB
Bash
Executable file

#!/bin/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
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-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 "-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