annotate tests/test-time.c @ 17593:d1e383af69e2

manywarnings: remove -Wmudflap * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Remove -Wmudflap, since it is no longer supported in gcc-4.9-to-be.
author Jim Meyering <meyering@fb.com>
date Thu, 02 Jan 2014 16:55:04 -0800
parents 344018b6e5d7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8181
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of <time.h> substitute.
17587
344018b6e5d7 maint: update copyright
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
2 Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc.
8181
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8181
diff changeset
4 This program is free software: you can redistribute it and/or modify
8181
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8181
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8181
diff changeset
7 (at your option) any later version.
8181
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8181
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
8181
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <time.h>
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
11832
ff3dd373542b stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents: 9309
diff changeset
23 #include "verify.h"
ff3dd373542b stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents: 9309
diff changeset
24
15594
f4cfbb6036d8 Ensure pid_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
25 /* Check that the types are all defined. */
f4cfbb6036d8 Ensure pid_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
26 struct timespec t1;
15730
8e2b0feee111 time tests: Don't require pid_t.
Bruno Haible <bruno@clisp.org>
parents: 15594
diff changeset
27 #if 0
8e2b0feee111 time tests: Don't require pid_t.
Bruno Haible <bruno@clisp.org>
parents: 15594
diff changeset
28 /* POSIX:2008 does not require pid_t in <time.h> unconditionally, and indeed
16935
498a2211d839 Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
29 it's missing on Mac OS X 10.5, FreeBSD 6.4, OpenBSD 4.9, mingw. */
15594
f4cfbb6036d8 Ensure pid_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
30 pid_t t2;
15730
8e2b0feee111 time tests: Don't require pid_t.
Bruno Haible <bruno@clisp.org>
parents: 15594
diff changeset
31 #endif
8181
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
11832
ff3dd373542b stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents: 9309
diff changeset
33 /* Check that NULL can be passed through varargs as a pointer type,
ff3dd373542b stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents: 9309
diff changeset
34 per POSIX 2008. */
ff3dd373542b stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents: 9309
diff changeset
35 verify (sizeof NULL == sizeof (void *));
ff3dd373542b stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents: 9309
diff changeset
36
8181
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 int
12197
e45d9bb2233e tests: avoid several compiler warnings
Eric Blake <ebb9@byu.net>
parents: 11832
diff changeset
38 main (void)
8181
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 {
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 return 0;
975e43bd00ee Tests for module 'time'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 }