View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013187CMakeCMakepublic2012-05-03 13:402016-06-10 14:31
ReporterPatrick Spendrin 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformWindowsOSWindowsOS Version7
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0013187: ARGVx is not reset in recursive function calls
DescriptionWhen 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 Reproducerun 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 InformationARGN 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.
TagsNo tags attached.
Attached Files

 Relationships
related to 0015380closedDaniele E. Domenichelli Misleading documentation in "Macro Argument Caveats" caveats 
has duplicate 0013387closedStephen Kelly ARGV1 scope leak 

  Notes
(0042038)
Kitware Robot (administrator)
2016-06-10 14:28

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2012-05-03 13:40 Patrick Spendrin New Issue
2012-07-09 13:33 Rolf Eike Beer Relationship added has duplicate 0013387
2015-02-26 16:34 Stephen Kelly Relationship added related to 0015380
2016-06-10 14:28 Kitware Robot Note Added: 0042038
2016-06-10 14:28 Kitware Robot Status new => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team