mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-27 17:39:51 -05:00
break: Add policy CMP0055 to check calls strictly
Reject break() without loop scope or any arguments. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
This commit is contained in:
@@ -112,3 +112,4 @@ All Policies
|
||||
/policy/CMP0052
|
||||
/policy/CMP0053
|
||||
/policy/CMP0054
|
||||
/policy/CMP0055
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
CMP0055
|
||||
-------
|
||||
|
||||
Strict checking for the :command:`break` command.
|
||||
|
||||
CMake 3.1 and lower allowed calls to the :command:`break` command
|
||||
outside of a loop context and also ignored any given arguments.
|
||||
This was undefined behavior.
|
||||
|
||||
The OLD behavior for this policy is to allow :command:`break` to be placed
|
||||
outside of loop contexts and ignores any arguments. The NEW behavior for this
|
||||
policy is to issue an error if a misplaced break or any arguments are found.
|
||||
|
||||
This policy was introduced in CMake version 3.2.
|
||||
CMake version |release| warns when the policy is not set and uses
|
||||
OLD behavior. Use the cmake_policy command to set it to OLD or
|
||||
NEW explicitly.
|
||||
@@ -0,0 +1,6 @@
|
||||
break-command-strictness
|
||||
------------------------
|
||||
|
||||
* The :command:`break` command now rejects calls outside of a loop
|
||||
context or that pass arguments to the command.
|
||||
See policy :policy:`CMP0055`.
|
||||
Reference in New Issue
Block a user