GNU bug report logs - #13448
Cannot build Emacs 24.2.92

Previous Next

Package: emacs;

Reported by: Xue Fuqiao <xfq.free <at> gmail.com>

Date: Tue, 15 Jan 2013 10:01:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13448 in the body.
You can then email your comments to 13448 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Tue, 15 Jan 2013 10:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Xue Fuqiao <xfq.free <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 15 Jan 2013 10:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Xue Fuqiao <xfq.free <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 17:59:31 +0800
[Message part 1 (text/plain, inline)]
I configured Emacs pretest 24.2.92 using:

    ./configure --with-wide-int --enable-link-time-optimization --enable-gcc-warnings

Then I:

    make

After that:

See attachment.

I'm using Ubuntu 12.10 to build Emacs 24.2.92.
-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao
[make.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Tue, 15 Jan 2013 16:16:01 GMT) Full text and rfc822 format available.

Message #8 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Xue Fuqiao <xfq.free <at> gmail.com>
Cc: 13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 18:15:38 +0200
> Date: Tue, 15 Jan 2013 17:59:31 +0800
> From: Xue Fuqiao <xfq.free <at> gmail.com>
> 
> In file included from /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:250:0,
>                  from /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:640,
>                  from :20:
> /home/xfq/emacs-24.2.92/lib-src/make-docfile.c: In function ‘main’:
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:98:3: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> In file included from /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:247:0,
>                  from /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:640,
>                  from :20:
> /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:627:19: note: ‘type’ was declared here

Please don't assume that we know by heart what's on line 98 of
stdio2.h on your system.  Show us.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Tue, 15 Jan 2013 17:25:01 GMT) Full text and rfc822 format available.

Message #11 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Xue Fuqiao <xfq.free <at> gmail.com>
Cc: 13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 12:23:50 -0500
Xue Fuqiao wrote:

> I configured Emacs pretest 24.2.92 using:
>
>     ./configure --with-wide-int --enable-link-time-optimization --enable-gcc-warnings

[...]

> /usr/include/x86_64-linux-gnu/bits/stdio2.h:98:3:
               ^^^^^^

Is there any point using --with-wide-int on what seems to be a 64-bit system?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Tue, 15 Jan 2013 18:50:01 GMT) Full text and rfc822 format available.

Message #14 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Xue Fuqiao <xfq.free <at> gmail.com>
Cc: eggert <at> cs.ucla.edu, 13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 19:48:46 +0100
Xue Fuqiao <xfq.free <at> gmail.com> writes:

> In file included from /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:250:0,
>                  from /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:640,
>                  from :20:
> /home/xfq/emacs-24.2.92/lib-src/make-docfile.c: In function ‘main’:
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:98:3: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> In file included from /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:247:0,
>                  from /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:640,
>                  from :20:
> /home/xfq/emacs-24.2.92/lib-src/make-docfile.c:627:19: note: ‘type’ was declared here

Your compiler isn't smart enough to see that the variable type is always
initialized before use.  But emacs shouldn't use -Wmaybe-uninitialized
anyway, since that triggers a lot of spurious warnings in various
compilers.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Tue, 15 Jan 2013 19:09:01 GMT) Full text and rfc822 format available.

Message #17 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Xue Fuqiao <xfq.free <at> gmail.com>, eggert <at> cs.ucla.edu, 13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 14:08:05 -0500
Andreas Schwab wrote:

> initialized before use.  But emacs shouldn't use -Wmaybe-uninitialized
> anyway, since that triggers a lot of spurious warnings in various
> compilers.

So this is caused by use of --enable-gcc-warnings?
Which is advertised as a developer option, and says "may generate false
alarms when used with older or non-GNU development tools".
Sounds like notabug to me.

(It seems confusing if --enable-gcc-warnings actually enables _errors_
rather than warnings though.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Tue, 15 Jan 2013 19:37:02 GMT) Full text and rfc822 format available.

Message #20 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Xue Fuqiao <xfq.free <at> gmail.com>, eggert <at> cs.ucla.edu, 13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 14:36:08 -0500
Glenn Morris wrote:

> (It seems confusing if --enable-gcc-warnings actually enables _errors_
> rather than warnings though.)

https://www.gnu.org/software/gnulib/manual/html_node/warnings.html

says

   Note that it is a bad idea to use gl_WARN_ADD([-Werror]). The
   warnings emitted by GCC depend, to some extent, on the contents of
   the system header files, on the size and signedness of built-in
   types, etc. Use of -Werror would cause frustration to all users on
   platforms that the maintainer has not tested before the release. It
   is better if maintainers use -Werror only for themselves

So why does configure.ac contain this:

   gl_WARN_ADD([-Werror], [WERROR_CFLAGS])

with WERROR_CFLAGS being unconditionally added to ALL_CFLAGS?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Tue, 15 Jan 2013 20:42:01 GMT) Full text and rfc822 format available.

Message #23 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Xue Fuqiao <xfq.free <at> gmail.com>, Gnulib Bugs <bug-gnulib <at> gnu.org>,
	Andreas Schwab <schwab <at> linux-m68k.org>, 13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 12:40:26 -0800
On 01/15/13 11:36, Glenn Morris wrote:
> So why does configure.ac contain this:
> 
>    gl_WARN_ADD([-Werror], [WERROR_CFLAGS])

That part of the Gnulib manual was out of date.
I pushed the following fix to the Gnulib manual.

---
 ChangeLog         |  7 +++++++
 doc/warnings.texi | 15 +++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 79defc9..1cdc89f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-15  Paul Eggert  <eggert <at> cs.ucla.edu>
+
+	doc: clarify -Werror
+	* doc/warnings.texi (warnings): -Werror is not always a bad idea;
+	clarify that it's intended for developers, not for ordinary builds,
+	and mention --enable-gcc-warnings as one possible use.
+
 2013-01-15  Andoni Morales Alastruey  <ylatuya <at> gmail.com>  (tiny change)
 
 	stdint: fix build with Android's Bionic fox x86
diff --git a/doc/warnings.texi b/doc/warnings.texi
index 40dfc20..1836c04 100644
--- a/doc/warnings.texi
+++ b/doc/warnings.texi
@@ -21,10 +21,15 @@ from gnulib), it is useful to apply different warning options to
 different directories.
 
 @item
-It allows to use @samp{-Werror} at @samp{make distcheck} time, to verify
+It lets you use @samp{-Werror} at @samp{make distcheck} time, to verify
 that on the maintainer's system, no warnings remain.  (Note that use of
 @samp{-Werror} in @code{CFLAGS} does not work in general, because it may
 break autoconfiguration.)
+
+@item
+Similarly, it lets you use @samp{-Werror} when the builder runs
+@command{configure} with an option such as
+@option{--enable-gcc-warnings}.
 @end itemize
 
 To use this module, you need the following:
@@ -49,10 +54,12 @@ and before @code{CFLAGS} in build rules emitted by Automake.  This allows
 the user to provide @code{CFLAGS} that override the @code{WARN_CFLAGS}.
 @end enumerate
 
-Note that it is a bad idea to use @samp{gl_WARN_ADD([-Werror])}.  The
+@samp{gl_WARN_ADD([-Werror])} is intended for developers, and should be
+avoided in contexts where it would affect ordinary installation builds.  The
 warnings emitted by GCC depend, to some extent, on the contents of the
 system header files, on the size and signedness of built-in types, etc.
 Use of @samp{-Werror} would cause frustration to all users on platforms
 that the maintainer has not tested before the release.  It is better if
-maintainers use @samp{-Werror} only for themselves (for example, during
-@samp{make distcheck}, as mentioned above).
+@samp{-Werror} is off by default, and is enabled only by developers.
+For example, @samp{-Werror} could affect @samp{make distcheck} or
+@samp{configure --enable-gcc-warnings} as mentioned above.
-- 
1.7.11.7






Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 15 Jan 2013 21:31:01 GMT) Full text and rfc822 format available.

Notification sent to Xue Fuqiao <xfq.free <at> gmail.com>:
bug acknowledged by developer. (Tue, 15 Jan 2013 21:31:02 GMT) Full text and rfc822 format available.

Message #28 received at 13448-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Xue Fuqiao <xfq.free <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, Andreas Schwab <schwab <at> linux-m68k.org>,
	13448-done <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 13:30:21 -0800
Enabling link time optimization is a common enough need and
there's a simple fix that I think makes Emacs a bit clearer,
so I pushed the following patch to the trunk as bzr 111533
and I'm marking this as done.

The original problem feels like it might be a GCC problem --
GCC shouldn't be dumber (and presumably generate worse code)
merely because link-time optimization is enabled.  Do you
have the time to file a GCC bug report?

=== modified file 'lib-src/ChangeLog'
--- lib-src/ChangeLog	2013-01-02 16:13:04 +0000
+++ lib-src/ChangeLog	2013-01-15 21:24:53 +0000
@@ -1,3 +1,9 @@
+2013-01-15  Paul Eggert  <eggert <at> cs.ucla.edu>
+
+	* make-docfile.c (write_globals): Make it a bit clearer (Bug#13448).
+	This pacifies GCC 4.7.2 when Emacs is configured with
+	--enable-link-time-optimization and --enable-gcc-warnings.
+
 2013-01-01  Juanma Barranquero  <lekktu <at> gmail.com>
 
 	* makefile.w32-in (lisp1): Add macroexp.elc (bug#13320).

=== modified file 'lib-src/make-docfile.c'
--- lib-src/make-docfile.c	2013-01-01 09:11:05 +0000
+++ lib-src/make-docfile.c	2013-01-15 21:23:34 +0000
@@ -624,7 +624,7 @@
   qsort (globals, num_globals, sizeof (struct global), compare_globals);
   for (i = 0; i < num_globals; ++i)
     {
-      char const *type;
+      char const *type = 0;
 
       switch (globals[i].type)
 	{
@@ -649,7 +649,7 @@
 	  fatal ("not a recognized DEFVAR_", 0);
 	}
 
-      if (globals[i].type != FUNCTION)
+      if (type)
 	{
 	  fprintf (outfile, "  %s f_%s;\n", type, globals[i].name);
 	  fprintf (outfile, "#define %s globals.f_%s\n",





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Wed, 16 Jan 2013 00:07:01 GMT) Full text and rfc822 format available.

Message #31 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Xue Fuqiao <xfq.free <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Wed, 16 Jan 2013 08:05:50 +0800
[Message part 1 (text/plain, inline)]
On Tue, 15 Jan 2013 18:15:38 +0200
Eli Zaretskii <eliz <at> gnu.org> wrote:

> Please don't assume that we know by heart what's on line 98 of
> stdio2.h on your system.  Show us.

  return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao
[stdio2.h (text/x-chdr, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Wed, 16 Jan 2013 00:33:02 GMT) Full text and rfc822 format available.

Message #34 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Xue Fuqiao <xfq.free <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Wed, 16 Jan 2013 08:32:10 +0800
On Tue, 15 Jan 2013 12:23:50 -0500
Glenn Morris <rgm <at> gnu.org> wrote:

> Is there any point using --with-wide-int on what seems to be a 64-bit system?

Sorry, I forgot about it.
-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Wed, 16 Jan 2013 01:03:02 GMT) Full text and rfc822 format available.

Message #37 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Xue Fuqiao <xfq.free <at> gmail.com>, Andreas Schwab <schwab <at> linux-m68k.org>,
	13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 20:02:06 -0500
Paul Eggert wrote:

> I pushed the following fix to the Gnulib manual.

OK, but for Emacs:

  (It seems confusing if --enable-gcc-warnings actually enables _errors_
  rather than warnings though.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Wed, 16 Jan 2013 02:20:01 GMT) Full text and rfc822 format available.

Message #40 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Xue Fuqiao <xfq.free <at> gmail.com>, Andreas Schwab <schwab <at> linux-m68k.org>,
	13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 18:18:44 -0800
On 01/15/2013 05:02 PM, Glenn Morris wrote:
> OK, but for Emacs:
> 
>   (It seems confusing if --enable-gcc-warnings actually enables _errors_
>   rather than warnings though.)

That's what the flag does in other GNU packages.
We could change it to --enable-gcc-errors, I suppose,
but if we do that we should change the name for all
packages that use that option in this way.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Wed, 16 Jan 2013 02:28:02 GMT) Full text and rfc822 format available.

Message #43 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Xue Fuqiao <xfq.free <at> gmail.com>, Andreas Schwab <schwab <at> linux-m68k.org>,
	13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 21:26:53 -0500
Paul Eggert wrote:

> On 01/15/2013 05:02 PM, Glenn Morris wrote:
>
>>   (It seems confusing if --enable-gcc-warnings actually enables _errors_
>>   rather than warnings though.)
>
> That's what the flag does in other GNU packages. We could change it to
> --enable-gcc-errors, I suppose, but if we do that we should change the
> name for all packages that use that option in this way.

Just changing the description (eg to "lots of GCC warnings/errors") is
fine by me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13448; Package emacs. (Wed, 16 Jan 2013 06:06:02 GMT) Full text and rfc822 format available.

Message #46 received at 13448 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Xue Fuqiao <xfq.free <at> gmail.com>, Andreas Schwab <schwab <at> linux-m68k.org>,
	13448 <at> debbugs.gnu.org
Subject: Re: bug#13448: Cannot build Emacs 24.2.92
Date: Tue, 15 Jan 2013 22:05:22 -0800
On 01/15/2013 06:26 PM, Glenn Morris wrote:
> Just changing the description (eg to "lots of GCC warnings/errors") is
> fine by me.

OK, done as trunk bzr 111536.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 13 Feb 2013 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 95 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.