[cmake-developers] [CMake 0013387]: ARGV1 scope leak

Mantis Bug Tracker mantis at public.kitware.com
Mon Jul 9 12:13:00 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://cmake.org/Bug/view.php?id=13387 
====================================================================== 
Reported By:                Clinton Stimpson
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13387
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-07-09 12:13 EDT
Last Modified:              2012-07-09 12:13 EDT
====================================================================== 
Summary:                    ARGV1 scope leak
Description: 
ARGV1 values can leak into sub functions if they are optional arguments.

Steps to Reproduce: 
cmake_minimum_required(VERSION 2.8)

function(bar arg)
  set(bar_arg ${ARGV1})
  message("bar_arg=${bar_arg}")
endfunction()

function(foo arg)
  set(foo_arg "${ARGV1}")
  message("foo_arg=${foo_arg}")
  bar(${arg})
endfunction()

foo(dummy dummy2)

========

bar() was called with 1 argument, not 2.  But the ARGV1 from foo() leaked into
the ARGV1 of bar().
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-07-09 12:13 Clinton StimpsonNew Issue                                    
======================================================================




More information about the cmake-developers mailing list