all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michal Nazarewicz <mpn@google.com>
Cc: 24424@debbugs.gnu.org
Subject: bug#24424: Emacs fails to build with --enable-gcc-warnings on gcc 4.8.4
Date: Tue, 13 Sep 2016 17:26:55 +0300	[thread overview]
Message-ID: <83oa3r98pc.fsf@gnu.org> (raw)
In-Reply-To: <xa1toa3sg7po.fsf@mina86.com> (message from Michal Nazarewicz on Mon, 12 Sep 2016 22:54:11 +0200)

tags 24424 + notabug
thanks

> From: Michal Nazarewicz <mpn@google.com>
> Date: Mon, 12 Sep 2016 22:54:11 +0200
> 
> Building with --enable-gcc-warnings results in:
> 
> CC       bidi.o
> bidi.c: In function ‘bidi_find_bracket_pairs’:
> bidi.c:2765:38: error: ‘pairing_pos’ may be used uninitialized in this
> function [-Werror=maybe-uninitialized]
> bidi_it->next_for_neutral.charpos = pairing_pos;
> ^
> cc1: all warnings being treated as errors
> 
> $ gcc --version
> gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
> 
> Cursory look at the function did not reveal obvious solution.

I don't see this warning on my system, with GCC 5.3.  I suggest to
upgrade your GCC version, or omit this switch from the command line.
Paul will correct me if I'm wrong, but IME these paranoid warning
switches are only usable with GCC 5 (or maybe 4.9) and later, and
yield too many false positives with earlier versions.

There's nothing wrong with the code in that function.  Its 'while (1)'
loop can only be exited via one of the 2 'break' statements.  The
former of these two exits assigns 'true' to 'retval', the 2nd gives a
value to 'pairing_pos':

	  if (type == NEUTRAL_B
	      || (bidi_it->level_stack[bidi_it->stack_idx].level
		  != current_level))
	    {
	      /* We've marched all the way to the end of this
		 isolating run sequence, and didn't find matching
		 closing brackets for some opening brackets.  Leave
		 their type unchanged.  */
	      pairing_pos = bidi_it->charpos;
	      break;
	    }

In the former case, 'pairing_pos' gets its value after the loop:

	  if (retval)
	    pairing_pos = bidi_it->bracket_pairing_pos;

(The 'while (1)' loop can also be exited via 'goto give_up', but in
that case the value of 'pairing_pos' is not used at all.)





      reply	other threads:[~2016-09-13 14:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 20:54 bug#24424: Emacs fails to build with --enable-gcc-warnings on gcc 4.8.4 Michal Nazarewicz
2016-09-13 14:26 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83oa3r98pc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24424@debbugs.gnu.org \
    --cc=mpn@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.