gnulib.git
14 years agowarn-on-use: new module
Eric Blake [Wed, 16 Dec 2009 21:53:06 +0000 (14:53 -0700)]
warn-on-use: new module

The goal of GNULIB_POSIXCHECK is to allow a developer on a reasonably
portable system to detect instances where they may have succeeded
because their system is up-to-date, but where compilation would fail
or create a misbehaving application on some other system due to some
portability problem, all without requiring that the developer have
access to other machines.  In other words, we want to poison all
interfaces that have a gnulib replacement if the corresponding gnulib
module is not in use.  For macros, the solution is undefining the
macro; unfortunately this causes compilation error without many
details as to why, but it is better than nothing.  For functions, the
solution is to cause a warning if the function is used.

Previously, the link-warning could poison functions, but only on glibc
systems and with gcc.  This module introduces _GL_WARN_ON_USE as a way
of poisoning functions for a few more systems.

Using the gcc __warning__ attribute (added in 4.3.0, early 2008)
rather than using link-warning.h is favorable because:
1) Provides a warning immediately at compile-time. The user does not
   have to wait until he links a program.
2) Less use of C macros. Less risk of collision.
3) It's available on more platforms. Depends only on GCC.
4) The formatting of the message is nicer.

There is a minor regression: the gcc attribute is currently not as
powerful as a link warning at detecting uses via function pointers:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42384
However, that style of coding is less frequent.

* modules/warn-on-use: New file.
* build-aux/warn-on-use.h: Likewise.
* m4/warn-on-use.m4: Likewise.
* MODULES.html.sh (Support for building): Mention it.

Signed-off-by: Eric Blake <ebb9@byu.net>
14 years agoTests for module 'unistr/u32-strdup'.
Bruno Haible [Sun, 10 Jan 2010 22:58:34 +0000 (23:58 +0100)]
Tests for module 'unistr/u32-strdup'.

14 years agoTests for module 'unistr/u16-strdup'.
Bruno Haible [Sun, 10 Jan 2010 22:58:08 +0000 (23:58 +0100)]
Tests for module 'unistr/u16-strdup'.

14 years agoTests for module 'unistr/u8-strdup'.
Bruno Haible [Sun, 10 Jan 2010 22:57:41 +0000 (23:57 +0100)]
Tests for module 'unistr/u8-strdup'.

14 years agoTests for module 'unistr/u32-strncmp'.
Bruno Haible [Sun, 10 Jan 2010 22:49:09 +0000 (23:49 +0100)]
Tests for module 'unistr/u32-strncmp'.

14 years agoTests for module 'unistr/u16-strncmp'.
Bruno Haible [Sun, 10 Jan 2010 22:48:36 +0000 (23:48 +0100)]
Tests for module 'unistr/u16-strncmp'.

14 years agoTests for module 'unistr/u8-strncmp'.
Bruno Haible [Sun, 10 Jan 2010 22:47:58 +0000 (23:47 +0100)]
Tests for module 'unistr/u8-strncmp'.

14 years agoTests for module 'unistr/u32-strcoll'.
Bruno Haible [Sun, 10 Jan 2010 22:47:04 +0000 (23:47 +0100)]
Tests for module 'unistr/u32-strcoll'.

14 years agoTests for module 'unistr/u16-strcoll'.
Bruno Haible [Sun, 10 Jan 2010 22:46:38 +0000 (23:46 +0100)]
Tests for module 'unistr/u16-strcoll'.

14 years agoTests for module 'unistr/u8-strcoll'.
Bruno Haible [Sun, 10 Jan 2010 22:46:10 +0000 (23:46 +0100)]
Tests for module 'unistr/u8-strcoll'.

14 years agoTests for module 'unistr/u32-strcmp'.
Bruno Haible [Sun, 10 Jan 2010 22:45:02 +0000 (23:45 +0100)]
Tests for module 'unistr/u32-strcmp'.

14 years agoTests for module 'unistr/u16-strcmp'.
Bruno Haible [Sun, 10 Jan 2010 22:44:31 +0000 (23:44 +0100)]
Tests for module 'unistr/u16-strcmp'.

14 years agoTests for module 'unistr/u8-strcmp'.
Bruno Haible [Sun, 10 Jan 2010 22:43:59 +0000 (23:43 +0100)]
Tests for module 'unistr/u8-strcmp'.

14 years agoTests for module 'unistr/u32-strncat'.
Bruno Haible [Sun, 10 Jan 2010 22:42:54 +0000 (23:42 +0100)]
Tests for module 'unistr/u32-strncat'.

14 years agoTests for module 'unistr/u16-strncat'.
Bruno Haible [Sun, 10 Jan 2010 22:42:22 +0000 (23:42 +0100)]
Tests for module 'unistr/u16-strncat'.

14 years agoTests for module 'unistr/u8-strncat'.
Bruno Haible [Sun, 10 Jan 2010 22:41:51 +0000 (23:41 +0100)]
Tests for module 'unistr/u8-strncat'.

14 years agoTests for module 'unistr/u32-strcat'.
Bruno Haible [Sun, 10 Jan 2010 22:40:58 +0000 (23:40 +0100)]
Tests for module 'unistr/u32-strcat'.

14 years agoTests for module 'unistr/u16-strcat'.
Bruno Haible [Sun, 10 Jan 2010 22:40:32 +0000 (23:40 +0100)]
Tests for module 'unistr/u16-strcat'.

14 years agoTests for module 'unistr/u8-strcat'.
Bruno Haible [Sun, 10 Jan 2010 22:40:00 +0000 (23:40 +0100)]
Tests for module 'unistr/u8-strcat'.

14 years agoTests for module 'unistr/u32-stpncpy'.
Bruno Haible [Sun, 10 Jan 2010 22:39:00 +0000 (23:39 +0100)]
Tests for module 'unistr/u32-stpncpy'.

14 years agoTests for module 'unistr/u16-stpncpy'.
Bruno Haible [Sun, 10 Jan 2010 22:38:33 +0000 (23:38 +0100)]
Tests for module 'unistr/u16-stpncpy'.

14 years agoTests for module 'unistr/u8-stpncpy'.
Bruno Haible [Sun, 10 Jan 2010 22:38:04 +0000 (23:38 +0100)]
Tests for module 'unistr/u8-stpncpy'.

14 years agoTests for module 'unistr/u32-strncpy'.
Bruno Haible [Sun, 10 Jan 2010 22:37:10 +0000 (23:37 +0100)]
Tests for module 'unistr/u32-strncpy'.

14 years agoTests for module 'unistr/u16-strncpy'.
Bruno Haible [Sun, 10 Jan 2010 22:36:40 +0000 (23:36 +0100)]
Tests for module 'unistr/u16-strncpy'.

14 years agoTests for module 'unistr/u8-strncpy'.
Bruno Haible [Sun, 10 Jan 2010 22:36:07 +0000 (23:36 +0100)]
Tests for module 'unistr/u8-strncpy'.

14 years agoTests for module 'unistr/u32-stpcpy'.
Bruno Haible [Sun, 10 Jan 2010 22:35:09 +0000 (23:35 +0100)]
Tests for module 'unistr/u32-stpcpy'.

14 years agoTests for module 'unistr/u16-stpcpy'.
Bruno Haible [Sun, 10 Jan 2010 22:34:33 +0000 (23:34 +0100)]
Tests for module 'unistr/u16-stpcpy'.

14 years agoTests for module 'unistr/u8-stpcpy'.
Bruno Haible [Sun, 10 Jan 2010 22:34:03 +0000 (23:34 +0100)]
Tests for module 'unistr/u8-stpcpy'.

14 years agoTests for module 'unistr/u32-strcpy'.
Bruno Haible [Sun, 10 Jan 2010 22:33:09 +0000 (23:33 +0100)]
Tests for module 'unistr/u32-strcpy'.

14 years agoTests for module 'unistr/u16-strcpy'.
Bruno Haible [Sun, 10 Jan 2010 22:32:36 +0000 (23:32 +0100)]
Tests for module 'unistr/u16-strcpy'.

14 years agoTests for module 'unistr/u8-strcpy'.
Bruno Haible [Sun, 10 Jan 2010 22:32:03 +0000 (23:32 +0100)]
Tests for module 'unistr/u8-strcpy'.

14 years agoTests for module 'unistr/u32-strnlen'.
Bruno Haible [Sun, 10 Jan 2010 19:13:20 +0000 (20:13 +0100)]
Tests for module 'unistr/u32-strnlen'.

14 years agoTests for module 'unistr/u16-strnlen'.
Bruno Haible [Sun, 10 Jan 2010 19:12:54 +0000 (20:12 +0100)]
Tests for module 'unistr/u16-strnlen'.

14 years agoTests for module 'unistr/u8-strnlen'.
Bruno Haible [Sun, 10 Jan 2010 19:12:20 +0000 (20:12 +0100)]
Tests for module 'unistr/u8-strnlen'.

14 years agoTests for module 'unistr/u32-strlen'.
Bruno Haible [Sun, 10 Jan 2010 18:30:55 +0000 (19:30 +0100)]
Tests for module 'unistr/u32-strlen'.

14 years agoTests for module 'unistr/u16-strlen'.
Bruno Haible [Sun, 10 Jan 2010 18:30:26 +0000 (19:30 +0100)]
Tests for module 'unistr/u16-strlen'.

14 years agoTests for module 'unistr/u8-strlen'.
Bruno Haible [Sun, 10 Jan 2010 18:29:58 +0000 (19:29 +0100)]
Tests for module 'unistr/u8-strlen'.

14 years agoTests for module 'unistr/u32-prev'.
Bruno Haible [Sun, 10 Jan 2010 18:20:32 +0000 (19:20 +0100)]
Tests for module 'unistr/u32-prev'.

14 years agoTests for module 'unistr/u16-prev'.
Bruno Haible [Sun, 10 Jan 2010 18:20:03 +0000 (19:20 +0100)]
Tests for module 'unistr/u16-prev'.

14 years agoTests for module 'unistr/u8-prev'.
Bruno Haible [Sun, 10 Jan 2010 18:19:34 +0000 (19:19 +0100)]
Tests for module 'unistr/u8-prev'.

14 years agoTests for module 'unistr/u32-next'.
Bruno Haible [Sun, 10 Jan 2010 17:00:04 +0000 (18:00 +0100)]
Tests for module 'unistr/u32-next'.

14 years agoTests for module 'unistr/u16-next'.
Bruno Haible [Sun, 10 Jan 2010 16:59:38 +0000 (17:59 +0100)]
Tests for module 'unistr/u16-next'.

14 years agoTests for module 'unistr/u8-next'.
Bruno Haible [Sun, 10 Jan 2010 16:59:08 +0000 (17:59 +0100)]
Tests for module 'unistr/u8-next'.

14 years agoTests for module 'unistr/u32-strmbtouc'.
Bruno Haible [Sun, 10 Jan 2010 16:41:46 +0000 (17:41 +0100)]
Tests for module 'unistr/u32-strmbtouc'.

14 years agoTests for module 'unistr/u16-strmbtouc'.
Bruno Haible [Sun, 10 Jan 2010 16:41:21 +0000 (17:41 +0100)]
Tests for module 'unistr/u16-strmbtouc'.

14 years agoTests for module 'unistr/u8-strmbtouc'.
Bruno Haible [Sun, 10 Jan 2010 16:40:55 +0000 (17:40 +0100)]
Tests for module 'unistr/u8-strmbtouc'.

14 years agoTests for module 'unistr/u32-strmblen'.
Bruno Haible [Sun, 10 Jan 2010 16:40:14 +0000 (17:40 +0100)]
Tests for module 'unistr/u32-strmblen'.

14 years agoTests for module 'unistr/u16-strmblen'.
Bruno Haible [Sun, 10 Jan 2010 16:39:44 +0000 (17:39 +0100)]
Tests for module 'unistr/u16-strmblen'.

14 years agoTests for module 'unistr/u8-strmblen'.
Bruno Haible [Sun, 10 Jan 2010 16:39:19 +0000 (17:39 +0100)]
Tests for module 'unistr/u8-strmblen'.

14 years agoTests for module 'unistr/u32-cpy-alloc'.
Bruno Haible [Sun, 10 Jan 2010 16:16:50 +0000 (17:16 +0100)]
Tests for module 'unistr/u32-cpy-alloc'.

14 years agoTests for module 'unistr/u16-cpy-alloc'.
Bruno Haible [Sun, 10 Jan 2010 16:16:21 +0000 (17:16 +0100)]
Tests for module 'unistr/u16-cpy-alloc'.

14 years agoTests for module 'unistr/u8-cpy-alloc'.
Bruno Haible [Sun, 10 Jan 2010 16:15:53 +0000 (17:15 +0100)]
Tests for module 'unistr/u8-cpy-alloc'.

14 years agoTests for module 'unistr/u32-mbsnlen'.
Bruno Haible [Sun, 10 Jan 2010 17:05:31 +0000 (18:05 +0100)]
Tests for module 'unistr/u32-mbsnlen'.

14 years agoTests for module 'unistr/u16-mbsnlen'.
Bruno Haible [Sun, 10 Jan 2010 17:04:57 +0000 (18:04 +0100)]
Tests for module 'unistr/u16-mbsnlen'.

14 years agoTests for module 'unistr/u8-mbsnlen'.
Bruno Haible [Sun, 10 Jan 2010 17:04:24 +0000 (18:04 +0100)]
Tests for module 'unistr/u8-mbsnlen'.

14 years agoTests for module 'unistr/u32-chr'.
Bruno Haible [Sun, 10 Jan 2010 14:39:11 +0000 (15:39 +0100)]
Tests for module 'unistr/u32-chr'.

14 years agoTests for module 'unistr/u16-chr'.
Bruno Haible [Sun, 10 Jan 2010 14:38:42 +0000 (15:38 +0100)]
Tests for module 'unistr/u16-chr'.

14 years agoTests for module 'unistr/u8-chr'.
Bruno Haible [Sun, 10 Jan 2010 14:38:15 +0000 (15:38 +0100)]
Tests for module 'unistr/u8-chr'.

14 years agoTests for module 'unistr/u32-cmp2'.
Bruno Haible [Sun, 10 Jan 2010 14:37:03 +0000 (15:37 +0100)]
Tests for module 'unistr/u32-cmp2'.

14 years agoTests for module 'unistr/u16-cmp2'.
Bruno Haible [Sun, 10 Jan 2010 14:36:34 +0000 (15:36 +0100)]
Tests for module 'unistr/u16-cmp2'.

14 years agoTests for module 'unistr/u8-cmp2'.
Bruno Haible [Sun, 10 Jan 2010 14:36:00 +0000 (15:36 +0100)]
Tests for module 'unistr/u8-cmp2'.

14 years agoTests for module 'unistr/u32-cmp'.
Bruno Haible [Sun, 10 Jan 2010 14:34:14 +0000 (15:34 +0100)]
Tests for module 'unistr/u32-cmp'.

14 years agoTests for module 'unistr/u16-cmp'.
Bruno Haible [Sun, 10 Jan 2010 14:33:43 +0000 (15:33 +0100)]
Tests for module 'unistr/u16-cmp'.

14 years agoTests for module 'unistr/u8-cmp'.
Bruno Haible [Sun, 10 Jan 2010 14:33:11 +0000 (15:33 +0100)]
Tests for module 'unistr/u8-cmp'.

14 years agoTests for module 'unistr/u32-set'.
Bruno Haible [Sun, 10 Jan 2010 14:31:41 +0000 (15:31 +0100)]
Tests for module 'unistr/u32-set'.

14 years agoTests for module 'unistr/u16-set'.
Bruno Haible [Sun, 10 Jan 2010 14:31:13 +0000 (15:31 +0100)]
Tests for module 'unistr/u16-set'.

14 years agoTests for module 'unistr/u8-set'.
Bruno Haible [Sun, 10 Jan 2010 14:30:46 +0000 (15:30 +0100)]
Tests for module 'unistr/u8-set'.

14 years agoTests for module 'unistr/u32-move'.
Bruno Haible [Sun, 10 Jan 2010 14:29:41 +0000 (15:29 +0100)]
Tests for module 'unistr/u32-move'.

14 years agoTests for module 'unistr/u16-move'.
Bruno Haible [Sun, 10 Jan 2010 14:29:02 +0000 (15:29 +0100)]
Tests for module 'unistr/u16-move'.

14 years agoTests for module 'unistr/u8-move'.
Bruno Haible [Sun, 10 Jan 2010 14:28:30 +0000 (15:28 +0100)]
Tests for module 'unistr/u8-move'.

14 years agoTests for module 'unistr/u32-cpy'.
Bruno Haible [Sun, 10 Jan 2010 14:27:20 +0000 (15:27 +0100)]
Tests for module 'unistr/u32-cpy'.

14 years agoTests for module 'unistr/u16-cpy'.
Bruno Haible [Sun, 10 Jan 2010 14:26:50 +0000 (15:26 +0100)]
Tests for module 'unistr/u16-cpy'.

14 years agoTests for module 'unistr/u8-cpy'.
Bruno Haible [Sun, 10 Jan 2010 14:26:11 +0000 (15:26 +0100)]
Tests for module 'unistr/u8-cpy'.

14 years agoTests for module 'unistr/u32-uctomb'.
Bruno Haible [Sun, 10 Jan 2010 01:42:12 +0000 (02:42 +0100)]
Tests for module 'unistr/u32-uctomb'.

14 years agoTests for module 'unistr/u16-uctomb'.
Bruno Haible [Sun, 10 Jan 2010 01:41:36 +0000 (02:41 +0100)]
Tests for module 'unistr/u16-uctomb'.

14 years agoTests for module 'unistr/u8-uctomb'.
Bruno Haible [Sun, 10 Jan 2010 01:41:06 +0000 (02:41 +0100)]
Tests for module 'unistr/u8-uctomb'.

14 years agoTests for module 'unistr/u32-mbtoucr'.
Bruno Haible [Sun, 10 Jan 2010 00:27:52 +0000 (01:27 +0100)]
Tests for module 'unistr/u32-mbtoucr'.

14 years agoTests for module 'unistr/u16-mbtoucr'.
Bruno Haible [Sun, 10 Jan 2010 00:27:27 +0000 (01:27 +0100)]
Tests for module 'unistr/u16-mbtoucr'.

14 years agoTests for module 'unistr/u8-mbtoucr'.
Bruno Haible [Sun, 10 Jan 2010 00:26:56 +0000 (01:26 +0100)]
Tests for module 'unistr/u8-mbtoucr'.

14 years agoTests for module 'unistr/u32-mbtouc'.
Bruno Haible [Sun, 10 Jan 2010 00:25:47 +0000 (01:25 +0100)]
Tests for module 'unistr/u32-mbtouc'.

14 years agoTests for module 'unistr/u16-mbtouc'.
Bruno Haible [Sun, 10 Jan 2010 00:25:22 +0000 (01:25 +0100)]
Tests for module 'unistr/u16-mbtouc'.

14 years agoTests for module 'unistr/u8-mbtouc'.
Bruno Haible [Sun, 10 Jan 2010 00:24:52 +0000 (01:24 +0100)]
Tests for module 'unistr/u8-mbtouc'.

14 years agoTests for module 'unistr/u32-mbtouc-unsafe'.
Bruno Haible [Sun, 10 Jan 2010 00:23:30 +0000 (01:23 +0100)]
Tests for module 'unistr/u32-mbtouc-unsafe'.

14 years agoTests for module 'unistr/u16-mbtouc-unsafe'.
Bruno Haible [Sun, 10 Jan 2010 00:22:56 +0000 (01:22 +0100)]
Tests for module 'unistr/u16-mbtouc-unsafe'.

14 years agoTests for module 'unistr/u8-mbtouc-unsafe'.
Bruno Haible [Sun, 10 Jan 2010 00:22:18 +0000 (01:22 +0100)]
Tests for module 'unistr/u8-mbtouc-unsafe'.

14 years agoTests for module 'unistr/u32-mblen'.
Bruno Haible [Sun, 10 Jan 2010 00:20:02 +0000 (01:20 +0100)]
Tests for module 'unistr/u32-mblen'.

14 years agoTests for module 'unistr/u16-mblen'.
Bruno Haible [Sun, 10 Jan 2010 00:19:34 +0000 (01:19 +0100)]
Tests for module 'unistr/u16-mblen'.

14 years agoTests for module 'unistr/u8-mblen'.
Bruno Haible [Sun, 10 Jan 2010 00:19:04 +0000 (01:19 +0100)]
Tests for module 'unistr/u8-mblen'.

14 years agoTests for module 'unistr/u32-to-u16'.
Bruno Haible [Sat, 9 Jan 2010 22:36:41 +0000 (23:36 +0100)]
Tests for module 'unistr/u32-to-u16'.

14 years agoTests for module 'unistr/u32-to-u8'.
Bruno Haible [Sat, 9 Jan 2010 22:36:11 +0000 (23:36 +0100)]
Tests for module 'unistr/u32-to-u8'.

14 years agoTests for module 'unistr/u16-to-u32'.
Bruno Haible [Sat, 9 Jan 2010 22:35:38 +0000 (23:35 +0100)]
Tests for module 'unistr/u16-to-u32'.

14 years agoTests for module 'unistr/u16-to-u8'.
Bruno Haible [Sat, 9 Jan 2010 22:35:04 +0000 (23:35 +0100)]
Tests for module 'unistr/u16-to-u8'.

14 years agoTests for module 'unistr/u8-to-u32'.
Bruno Haible [Sat, 9 Jan 2010 22:34:24 +0000 (23:34 +0100)]
Tests for module 'unistr/u8-to-u32'.

14 years agoTests for module 'unistr/u8-to-u16'.
Bruno Haible [Sat, 9 Jan 2010 22:33:46 +0000 (23:33 +0100)]
Tests for module 'unistr/u8-to-u16'.

14 years agoTests for module 'unistr/u32-check'.
Bruno Haible [Sat, 9 Jan 2010 18:41:40 +0000 (19:41 +0100)]
Tests for module 'unistr/u32-check'.

14 years agoTests for module 'unistr/u16-check'.
Bruno Haible [Sat, 9 Jan 2010 18:41:06 +0000 (19:41 +0100)]
Tests for module 'unistr/u16-check'.

14 years agoTests for module 'unistr/u8-check'.
Bruno Haible [Sat, 9 Jan 2010 18:40:38 +0000 (19:40 +0100)]
Tests for module 'unistr/u8-check'.

14 years agoAdd more tests.
Bruno Haible [Sat, 9 Jan 2010 16:50:38 +0000 (17:50 +0100)]
Add more tests.

14 years agoAdd more tests.
Bruno Haible [Sat, 9 Jan 2010 16:34:29 +0000 (17:34 +0100)]
Add more tests.

14 years agounistr/u*-strcoll: Try harder to distinguish different strings.
Bruno Haible [Sun, 10 Jan 2010 22:11:54 +0000 (23:11 +0100)]
unistr/u*-strcoll: Try harder to distinguish different strings.