The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13187 
====================================================================== 
Reported By:                Patrick Spendrin
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13187
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-05-03 13:40 EDT
Last Modified:              2012-05-03 13:40 EDT
====================================================================== 
Summary:                    ARGVx is not reset in recursive function calls
Description: 
When recursively calling functions, ARGV0-ARGV9 are inherited by the inner
function calls - this will make it hard to decide for the inner function calls
to decide whether they got an argument or not.



Steps to Reproduce: 
run the following code:
function(testfunc1)
    message(STATUS "testfunc1: ${ARGV0} ${ARGV1} ${ARGV2}")
    testfunc2("${ARGV0}")
endfunction(testfunc1)

function(testfunc2)
    message(STATUS "testfunc2: ${ARGV0} ${ARGV1} ${ARGV2}")
endfunction(testfunc2)

testfunc1(para1 para2 para3)

expected result is 
L:\>cmake -P C:\kde\kde-stable\tmp\cmake-argv-bug\argv-bug.cmake
-- testfunc1: para1 para2 para3
-- testfunc2: para1

actual result is
L:\>cmake -P C:\kde\kde-stable\tmp\cmake-argv-bug\argv-bug.cmake
-- testfunc1: para1 para2 para3
-- testfunc2: para1 para2 para3

Additional Information: 
ARGN works as expected;
It is unclear whether anybody could rely on this bug, since it likely depends on
the order in which functions are called.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-03 13:40 Patrick SpendrinNew Issue                                    
======================================================================

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to