View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008397CMakeCMakepublic2009-01-19 02:562009-01-20 08:13
ReporterPhilip Lowman 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0008397: MACRO bug with constants
DescriptionThe FUNCTION works but the MACRO doesn't.

MACRO(test_constants_macro _a )
     MESSAGE("a = ${_a}")
     IF(_a)
         MESSAGE("test_constants_macro: a is true")
     ELSE()
         MESSAGE("test_constants_macro: ERROR: a is FALSE!")
     ENDIF()
ENDMACRO()
FUNCTION(test_constants_func _a )
     MESSAGE("a = ${_a}")
     IF(_a)
         MESSAGE("test_constants_func: a is true")
     ELSE()
         MESSAGE("test_constants_func: ERROR: a is FALSE!")
     ENDIF()
ENDFUNCTION()

test_constants_macro(1)
test_constants_macro(TRUE)
test_constants_macro(ON)
test_constants_func(1)
test_constants_func(TRUE)
test_constants_func(ON)

a = 1
test_constants_macro: ERROR: a is FALSE!
a = TRUE
test_constants_macro: ERROR: a is FALSE!
a = ON
test_constants_macro: ERROR: a is FALSE!
a = 1
test_constants_func: a is true
a = TRUE
test_constants_func: a is true
a = ON
test_constants_func: a is true
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0014643)
Brad King (manager)
2009-01-20 08:12

From the documentation of MACRO:

When it is invoked, the commands recorded in the macro are first modified by replacing formal parameters (${arg1}) with the arguments passed, and then invoked as normal commands.

Only the ${} syntax usage gets replaced. Macro arguments are not real variables.

 Issue History
Date Modified Username Field Change
2009-01-19 02:56 Philip Lowman New Issue
2009-01-19 18:07 Bill Hoffman Status new => assigned
2009-01-19 18:07 Bill Hoffman Assigned To => Brad King
2009-01-20 08:12 Brad King Note Added: 0014643
2009-01-20 08:13 Brad King Status assigned => closed
2009-01-20 08:13 Brad King Resolution open => won't fix


Copyright © 2000 - 2018 MantisBT Team