View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013387CMakeCMakepublic2012-07-09 12:132015-07-08 08:57
ReporterClinton Stimpson 
Assigned ToStephen Kelly 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionduplicate 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0013387: ARGV1 scope leak
DescriptionARGV1 values can leak into sub functions if they are optional arguments.
Steps To Reproducecmake_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().
TagsNo tags attached.
Attached Files

 Relationships
duplicate of 0013187closedKitware Robot ARGVx is not reset in recursive function calls 

  Notes
(0030004)
Clinton Stimpson (developer)
2012-07-09 12:19

This problem was found while using DeployQt4.cmake.
A workaround has been pushed.

374b9b9 DeployQt4: workaround bug 13258 where ARGV1 is leaked into a sub function.
(0030007)
Mike McQuaid (reporter)
2012-07-09 12:47

Thanks for reporting this.
(0038082)
Stephen Kelly (developer)
2015-02-26 14:06

The solution is documentation, which is currently being worked on.
(0039071)
Robert Maynard (manager)
2015-07-08 08:57

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-07-09 12:13 Clinton Stimpson New Issue
2012-07-09 12:19 Clinton Stimpson Note Added: 0030004
2012-07-09 12:47 Mike McQuaid Note Added: 0030007
2012-07-09 13:33 Rolf Eike Beer Relationship added duplicate of 0013187
2015-02-26 14:06 Stephen Kelly Note Added: 0038082
2015-02-26 14:06 Stephen Kelly Status new => resolved
2015-02-26 14:06 Stephen Kelly Resolution open => duplicate
2015-02-26 14:06 Stephen Kelly Assigned To => Stephen Kelly
2015-07-08 08:57 Robert Maynard Note Added: 0039071
2015-07-08 08:57 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team