mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 21:00:17 -06:00
Help: Clarify that ARGV# beyond ARGC will have an undefined behavior (#15380)
This commit is contained in:
@@ -24,6 +24,10 @@ This facilitates creating functions with optional arguments.
|
||||
Additionally ``ARGV`` holds the list of all arguments given to the
|
||||
function and ``ARGN`` holds the list of arguments past the last expected
|
||||
argument.
|
||||
Referencing to ``ARGV#`` arguments beyond ``ARGC`` have undefined
|
||||
behavior. Checking that ``ARGC`` is greater than ``#`` is the only way
|
||||
to ensure that ``ARGV#`` was passed to the function as an extra
|
||||
argument.
|
||||
|
||||
A function opens a new scope: see :command:`set(var PARENT_SCOPE)` for
|
||||
details.
|
||||
|
||||
Reference in New Issue
Block a user