From 603368864cb040295387822b6f47bbff73f15e44 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 8 Sep 2003 23:11:09 +0000 Subject: Script to check non-changing C++ type name mangling. --- scripts/check-c++-types.sh | 107 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100755 scripts/check-c++-types.sh (limited to 'scripts') diff --git a/scripts/check-c++-types.sh b/scripts/check-c++-types.sh new file mode 100755 index 0000000000..68af8091b2 --- /dev/null +++ b/scripts/check-c++-types.sh @@ -0,0 +1,107 @@ +#! /bin/bash +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C 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 +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# The list of data types has been created with +# cat < +# #include +# #include +# #include +# EOF +# gcc -D_GNU_SOURCE -E - | +# egrep '^typedef.*;$' | +# sed 's/^typedef[[:space:]]*//;s/\([[:space:]]\{1,\}__attribute__.*\);/;/;s/.*[[:space:]]\([*]\|\)\(.*\);/\2/' | +# egrep -v '^_' | +# sort -u +# +cxx=$1 +data=$2 +while read t; do + echo -n "$t:" + $cxx -S -xc++ -o - -D_GNU_SOURCE <(cat < +#include +#include +#include +void foo ($t) { } +EOF +) | + sed 's/[[:space:]]*[.]globa\?l[[:space:]]*_Z3foo\([_[:alnum:]]*\).*/\1/p;d' +done <