gpp icon indicating copy to clipboard operation
gpp copied to clipboard

gpp parameter -D<var>=<value> appears to always be 1

Open mofosyne opened this issue 7 years ago • 2 comments

Input testfile input.md

<#ifdef vara>testa<#else>testb<#endif>
<#if varb>x<#else>y<#endif>

Terminal Output

$ cat input.md | gpp -H -Dvara -Dvarb=1
testa
x
$ cat input.md | gpp -H -Dvarb=0
testb
x
$ gpp --version
GPP 2.24
Copyright (C) 1996-2001 Denis Auroux
Copyright (C) 2003, 2004 Tristan Miller
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mofosyne avatar Jun 03 '17 20:06 mofosyne

Thanks for the report. I think I understand what you are saying about the behaviour of <#if varb>x<#else>y<#endif>, but what is the problem with <#ifdef vara>testa<#else>testb<#endif>? Could you please tell me the expected behaviour for both invocations?

logological avatar Aug 31 '17 15:08 logological

Been a while, but I think there is no issues with #ifdef commands, just #if only. I was only posting it to contrast its behaviour with eachother I think

mofosyne avatar Sep 04 '17 10:09 mofosyne