Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 4,167
    • Issues 4,167
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Merge requests
  • !7041

while: Restore tolerance of condition error

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Alex Turbov requested to merge zaufi/cmake:bug/22524 into master Mar 03, 2022
  • Overview 7
  • Commits 2
  • Pipelines 3
  • Changes 7

Since !6442 (merged) we correctly reject the code

set(paren "(")
while(${paren})
endwhile()

However, rejecting it breaks compatibility with projects that used such code accidentally. In CMake 3.21 and below, any error in the condition was ignored because the false result exited the loop first. Restore tolerance of the error for now. A policy will be needed to make it an error later.

Note that the same condition with if was always correctly rejected.

Fixes: #22524 (closed)
Issue: #23296 (closed)
Backport: release
Topic-rename: while-bug-compatibility

Edited Mar 03, 2022 by Brad King
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: bug/22524