1CMP0121 2------- 3 4.. versionadded:: 3.21 5 6The :command:`list` command now detects invalid indices. 7 8Prior to CMake version 3.21, the :command:`list` command's ``GET``, 9``INSERT``, ``SUBLIST``, and ``REMOVE_AT`` subcommands did not detect invalid 10index arguments. 11 12The ``OLD`` behavior of this policy is for invalid indices to be treated as 13their integer value (if any) at the start of the string. For example, 14``2good4you`` is a ``2`` and ``not_an_integer`` is a ``0``. The ``NEW`` 15behavior is for invalid indices to trigger an error. 16 17This policy was introduced in CMake version 3.21. CMake version |release| 18warns when the policy is not set and uses ``OLD`` behavior. Use the 19:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. 20 21.. include:: DEPRECATED.txt 22