gettimeofday: port recent C++ fix to Emacs
[gnulib.git] / doc / error.texi
1 @node error and progname
2 @section error and progname
3 @findex error
4 @findex progname
5 @vindex program_name
6
7 @c Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
8
9 @c Permission is granted to copy, distribute and/or modify this document
10 @c under the terms of the GNU Free Documentation License, Version 1.3 or
11 @c any later version published by the Free Software Foundation; with no
12 @c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
13 @c Texts.  A copy of the license is included in the ``GNU Free
14 @c Documentation License'' file as part of this distribution.
15
16 The @code{error} function uses the @code{program_name} variable, but
17 does not depend on the @code{progname} module.  Why?  Because
18 @code{error} is released under the LGPL, whereas @code{progname} is
19 GPL.  RMS does not want additional baggage accompanying the
20 @code{error} module, so an LGPL user must provide their own
21 replacement @code{program_name}, and a GPL user should manually
22 specify using the @code{progname} module.
23
24 Additionally, using the @code{progname} module is not something that
25 can be done implicitly. It requires that every @code{main} function
26 be modified to set @code{program_name} as one of its first actions.