Landing: 8b4ed6bbfb9f

Project / Subsystem

gcc / cobol

Date

2026-05-20

Author

Jonathan Wakely

Commit

8b4ed6bbfb9fd4029a78265088e24b7500f33037

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
cobol
patch_id
commit_hash
8b4ed6bbfb9fd4029a78265088e24b7500f33037
source_type
github
headline
Cobol: Add assertion to prevent false array-bounds warning.
tldr
An assertion was added to symfind.cc to avoid a false positive from -Warray-bounds when compiling COBOL code with std::vector.
author
Jonathan Wakely
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • cobol
  • warning
  • array-bounds
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-05-20T00:00:00.000Z

An assertion has been added to symfind.cc to ensure that the ancestors vector is not empty before accessing its last element. This change addresses a false positive from the -Warray-bounds compiler warning, which incorrectly assumed the vector was empty, leading to a warning when back() was called. This does not change functionality, only avoids a spurious warning.