]> git.ipfire.org Git - thirdparty/glibc.git/blame - scripts/check-c++-types.sh
* scripts/check-local-headers.sh: New file.
[thirdparty/glibc.git] / scripts / check-c++-types.sh
CommitLineData
60336886 1#! /bin/bash
a334319f 2# Copyright (C) 2003 Free Software Foundation, Inc.
60336886
UD
3# This file is part of the GNU C Library.
4
5# The GNU C Library is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
9
10# The GNU C Library is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14
15# You should have received a copy of the GNU Lesser General Public
16# License along with the GNU C Library; if not, write to the Free
17# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18# 02111-1307 USA.
19#
20# The list of data types has been created with
21# cat <<EOF |
22# #include <sys/types.h>
23# #include <unistd.h>
24# #include <sys/resource.h>
25# #include <sys/stat.h>
26# EOF
27# gcc -D_GNU_SOURCE -E - |
28# egrep '^typedef.*;$' |
29# sed 's/^typedef[[:space:]]*//;s/\([[:space:]]\{1,\}__attribute__.*\);/;/;s/.*[[:space:]]\([*]\|\)\(.*\);/\2/' |
30# egrep -v '^_' |
a334319f 31# sort -u
60336886 32#
806e4a4a
UD
33data=$1
34shift
35cxx="$*"
60336886
UD
36while read t; do
37 echo -n "$t:"
38 $cxx -S -xc++ -o - -D_GNU_SOURCE <(cat <<EOF
39#include <sys/types.h>
40#include <sys/stat.h>
41#include <sys/resource.h>
42#include <unistd.h>
43void foo ($t) { }
44EOF
45) |
46 sed 's/[[:space:]]*[.]globa\?l[[:space:]]*_Z3foo\([_[:alnum:]]*\).*/\1/p;d'
47done <<EOF |
48blkcnt64_t
49blkcnt_t
50blksize_t
51caddr_t
52clockid_t
53clock_t
54daddr_t
55dev_t
56fd_mask
57fsblkcnt64_t
58fsblkcnt_t
59fsfilcnt64_t
60fsfilcnt_t
61fsid_t
62gid_t
63id_t
64ino64_t
65ino_t
66int16_t
67int32_t
68int64_t
69int8_t
70intptr_t
71key_t
72loff_t
73mode_t
74nlink_t
75off64_t
76off_t
77pid_t
78pthread_key_t
79pthread_once_t
80pthread_spinlock_t
81pthread_t
82quad_t
83register_t
84rlim64_t
85rlim_t
86sigset_t
87size_t
88socklen_t
89ssize_t
90suseconds_t
60336886
UD
91time_t
92u_char
93uid_t
94uint
95u_int
96u_int16_t
97u_int32_t
98u_int64_t
99u_int8_t
100ulong
101u_long
102u_quad_t
103useconds_t
104ushort
105u_short
106EOF
107diff -N -U0 $data -