Mercurial > gnulib
diff MODULES.html.sh @ 12723:72890f398afa
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>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Wed, 16 Dec 2009 14:53:06 -0700 |
parents | c2cbabec01dd |
children | fcd269d69e88 |
line wrap: on
line diff
--- a/MODULES.html.sh Sun Jan 10 23:58:34 2010 +0100 +++ b/MODULES.html.sh Wed Dec 16 14:53:06 2009 -0700 @@ -3172,6 +3172,7 @@ func_begin_table func_module absolute-header + func_module arg-nonnull func_module config-h func_module configmake func_module dummy @@ -3184,14 +3185,15 @@ func_module lib-msvc-compat func_module lib-symbol-versions func_module link-warning + func_module manywarnings func_module no-c++ func_module relocatable-lib func_module relocatable-lib-lgpl func_module relocatable-prog func_module relocatable-prog-wrapper func_module relocatable-script + func_module warn-on-use func_module warnings - func_module manywarnings func_end_table element="Support for building documentation"