annotate doc/posix-functions/alarm.texi @ 17366:9855b352e525

regex: port to mingw's recent addition of undeclared alarm On mingw (at least, when cross-compiling with Fedora 18's mingw32-headers-2.0.999-0.15.trunk.20121110.fc18.noarch build), compilation of test-regex fails: test-regex.c: In function 'main': test-regex.c:42:11: error: 'SIGALRM' undeclared (first use in this function) test-regex.c:42:11: note: each undeclared identifier is reported only once for each function it appears in test-regex.c:43:3: warning: implicit declaration of function 'alarm' It turns out that recent mingw64 added an export of alarm() and SIGALRM, but guarded their declarations behind __USE_MINGW_ALARM (default off, and with alarm() only in the non-standard <io.h>); so the m4 tests were setting HAVE_ALARM to 1 based on link success but then failing to compile. * doc/posix-functions/alarm.texi (alarm): Document that alarm exists but still doesn't work in newer mingw. * m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Check for alarm declaration, not existence. Ensure SIGALRM is not trapped. * m4/mktime.m4 (gl_FUNC_MKTIME): Likewise. * m4/regex.m4 (gl_REGEX): Likewise. * m4/remainderf.m4 (gl_FUNC_REMAINDERF_WORKS): Likewise. * tests/test-regex.c (main): Use correct probe for alarm. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Mon, 11 Mar 2013 14:51:33 -0600
parents 6355dc4626b5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 @node alarm
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 @section @code{alarm}
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 @findex alarm
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
13549
bb0ceefd22dc avoid some overlong lines from posix urls, etc.
Karl Berry <karl@freefriends.org>
parents: 10876
diff changeset
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/alarm.html}
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 Gnulib module: ---
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 Portability problems fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 @itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 @end itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 Portability problems not fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 @itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 @item
17366
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
16 This function has no impact if <code>SIGALRM</code> is inherited as
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
17 ignored; programs should use <code>signal (SIGALRM, SIG_DFL)</code> if
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
18 it is important to ensure the alarm will fire.
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
19 @item
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
20 Use of this function in multi-threaded applications is not advised.
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
21 @item
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 This function is missing on some platforms:
17366
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
23 mingw (2011), MSVC 9.
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
24 @item
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
25 This function is conditionally declared in the non-standard
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
26 @code{<io.h>} header on some platforms:
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 15607
diff changeset
27 mingw (2012 or newer).
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 @end itemize