modules/warn-on-use


Log

Author Commit Date CI Message
Bruce Korb 4013d14c 2011-02-06T21:11:40 libposix: Revert the unreviewed part of yesterday's big merge. Back out yesterday's big merge from the libposix branch, except for the openat-die.c change that was reviewed and approved by Paul Eggert. Put the ChangeLog entry at the top, to reflect the order of changes in the master branch.
Bruce Korb abac9b73 2011-02-05T08:22:48 libposix: Add _HEADERS primaries to posix modules. Modify gnulib-tool to strip them from generated Makefile.am-s where they are not needed. Also, replace M4 macro prefixes when requested. Finally, omit calls to error() for libposix.
Eric Blake 039dc49e 2009-12-16T14:53:06 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>