summaryrefslogtreecommitdiffstats
path: root/Help/command/function.rst
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2015-02-06 15:53:44 (GMT)
committerDaniele E. Domenichelli <daniele.domenichelli@iit.it>2015-02-26 16:42:30 (GMT)
commit4efef3f775e78bdcb4591dc37aa974bc28e8fd84 (patch)
treec39e424c58b00ed0e7689c8412026a01410e8c7a /Help/command/function.rst
parente3363bfbec592393780f9d769bd32334bcfd5953 (diff)
downloadCMake-4efef3f775e78bdcb4591dc37aa974bc28e8fd84.zip
CMake-4efef3f775e78bdcb4591dc37aa974bc28e8fd84.tar.gz
CMake-4efef3f775e78bdcb4591dc37aa974bc28e8fd84.tar.bz2
Help: Clarify that ARGV# beyond ARGC will have an undefined behavior (#15380)
Diffstat (limited to 'Help/command/function.rst')
-rw-r--r--Help/command/function.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Help/command/function.rst b/Help/command/function.rst
index 5bbffbf..7ffdfee 100644
--- a/Help/command/function.rst
+++ b/Help/command/function.rst
@@ -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.