Debian Codegraph @

gnulib-tests/test-sys_types-h.c

raw
1 /* Test of <sys/types.h> substitute.
2 Copyright (C) 2011-2025 Free Software Foundation, Inc.
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
16
17 /* Written by Bruno Haible <[email protected]>, 2011. */
18
19 #include <config.h>
20
21 #include <sys/types.h>
22
23 /* Check that the most important types are defined. */
24 pid_t t1;
25 size_t t2;
26 ssize_t t3;
27 off_t t4;
28 mode_t t5;
29 off64_t t6;
30 blksize_t t7;
31 blkcnt_t t8;
32
33 #include "intprops.h"
34
35 /* POSIX requires that pid_t is a signed integer type. */
36 static_assert (TYPE_SIGNED (pid_t));
37
38 /* POSIX requires that size_t is an unsigned integer type. */
39 static_assert (! TYPE_SIGNED (size_t));
40
41 /* POSIX requires that ssize_t is a signed integer type. */
42 static_assert (TYPE_SIGNED (ssize_t));
43
44 /* POSIX requires that off_t is a signed integer type. */
45 static_assert (TYPE_SIGNED (off_t));
46 static_assert (TYPE_SIGNED (off64_t));
47
48 /* POSIX requires that blksize_t is a signed integer type. */
49 #if !defined __ANDROID__
50 static_assert (TYPE_SIGNED (blksize_t));
51 #endif
52
53 /* POSIX requires that blkcnt_t is a signed integer type. */
54 #if !defined __ANDROID__
55 static_assert (TYPE_SIGNED (blkcnt_t));
56 #endif
57
58 int
59 main (void)
60 {
61 return 0;
62 }