Skip to content

Disable array bounds warning until GCC is fixed#7317

Merged
TheMarex merged 1 commit intomasterfrom
patrick/slicent_array_bounds
Jan 9, 2026
Merged

Disable array bounds warning until GCC is fixed#7317
TheMarex merged 1 commit intomasterfrom
patrick/slicent_array_bounds

Conversation

@TheMarex
Copy link
Copy Markdown
Member

@TheMarex TheMarex commented Jan 8, 2026

Issue

There are various issues around failing builds because of a false-positive in sol2. Simple "fix" is do disable the array bounds check for now. Workaround for #7129

Tasklist

@afarber
Copy link
Copy Markdown
Contributor

afarber commented Jan 8, 2026

Hi @TheMarex have you tried wrapping the #include <sol/sol.hpp> in scripting_environment_lua.hpp with #pragma GCC diagnostic ignored "-Warray-bounds"?

That would keep the warning enabled for OSRM's own code.

@TheMarex TheMarex force-pushed the patrick/slicent_array_bounds branch from 56b6520 to 0a040ca Compare January 8, 2026 17:12
@TheMarex
Copy link
Copy Markdown
Member Author

TheMarex commented Jan 8, 2026

@afarber Excellent suggestion, didn't know GCC supported that.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR works around a false-positive GCC array-bounds warning in the sol2 library by suppressing the warning using compiler diagnostic pragmas. This addresses build failures mentioned in issue #7129.

  • Adds #pragma GCC diagnostic directives around the sol2 include to suppress array-bounds warnings
  • Updates CHANGELOG.md to document the fix

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
include/extractor/scripting_environment_lua.hpp Adds GCC diagnostic pragmas to suppress false-positive array-bounds warnings around sol2 include
CHANGELOG.md Documents the compilation error fix under the Build section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/extractor/scripting_environment_lua.hpp Outdated
@TheMarex TheMarex force-pushed the patrick/slicent_array_bounds branch from e5f897a to a6041ab Compare January 8, 2026 22:14
@TheMarex TheMarex requested a review from DennisOSRM January 9, 2026 10:21
@TheMarex TheMarex merged commit 9dbb8a1 into master Jan 9, 2026
19 checks passed
@TheMarex TheMarex deleted the patrick/slicent_array_bounds branch January 9, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants