* bug#24424: Emacs fails to build with --enable-gcc-warnings on gcc 4.8.4
@ 2016-09-12 20:54 Michal Nazarewicz
2016-09-13 14:26 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Michal Nazarewicz @ 2016-09-12 20:54 UTC (permalink / raw)
To: 24424
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.
--
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#24424: Emacs fails to build with --enable-gcc-warnings on gcc 4.8.4
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
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2016-09-13 14:26 UTC (permalink / raw)
To: Michal Nazarewicz; +Cc: 24424
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.)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-13 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).