Skip to content

Commit 6a717f1

Browse files
committed
patch 8.0.0236: gcc complains about uninitialized variable
Problem: Gcc complains that a variable may be used uninitialized. Confusion between variable and label name. (John Marriott) Solution: Initialize it. Rename end to end_lnum.
1 parent b031c4e commit 6a717f1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/ops.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3774,13 +3774,13 @@ do_put(
37743774
*/
37753775
if (y_type == MCHAR && y_size == 1)
37763776
{
3777-
linenr_T end;
3777+
linenr_T end_lnum = 0; /* init for gcc */
37783778

37793779
if (VIsual_active)
37803780
{
3781-
end = curbuf->b_visual.vi_end.lnum;
3782-
if (end < curbuf->b_visual.vi_start.lnum)
3783-
end = curbuf->b_visual.vi_start.lnum;
3781+
end_lnum = curbuf->b_visual.vi_end.lnum;
3782+
if (end_lnum < curbuf->b_visual.vi_start.lnum)
3783+
end_lnum = curbuf->b_visual.vi_start.lnum;
37843784
}
37853785

37863786
do {
@@ -3815,7 +3815,7 @@ do_put(
38153815
}
38163816
if (VIsual_active)
38173817
lnum++;
3818-
} while (VIsual_active && lnum <= end);
3818+
} while (VIsual_active && lnum <= end_lnum);
38193819

38203820
if (VIsual_active) /* reset lnum to the last visual line */
38213821
lnum--;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
236,
767769
/**/
768770
235,
769771
/**/

0 commit comments

Comments
 (0)