bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Defining macros from the command line - bug


From: Stephen Borneman
Subject: Defining macros from the command line - bug
Date: Wed, 29 Sep 2004 18:00:38 +1000
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Hi,
I am writing a tool to work with the latest stable release of m4 and need to define macros on the command line with the use of the '-D' flag.
When doing this however I have found a what I think is quite strange:
If the value of the definition contains only alphabet characters then the definition does not take place. If, however, there is any kind of symbol the definition does take place and the macro expands as it should. Now I am aware that is the string is quoted with the `' then the value is passed but this means that I cannot refer to other macro definitions from the command line.

Below is the output from the different tests:
-----------------------------------------------------------------
TEST 1: just alphabet characters
> m4 test.m4 -D_TEST_=newdef
:: -- test.m4


expandforme
stangeness
------------------------------------------------------------------
TEST 2: with symbols
> m4 test.m4 -D_TEST_=`n'ewdef
:: -- test.m4


newdef
stangeness
----------------------------------------------------------------
TEST 3: quoted trying to refer to another defined macro
> m4 test.m4 -D_TEST_="`newdef _TESTTWO_'"
:: -- test.m4


newdef _TESTTWO_
stangeness
----------------------------------------------------------------

Attached is the file I used for this test.

If there is a logical explanation and work around that would be great, otherwise it would be really helpful if it was fixed.

Thanks,
Stephen Borneman


:: -- __file__
define(_TEST_,expandforme)dnl
define(_TESTTWO_,stangeness)dnl


_TEST_
_TESTTWO_

reply via email to

[Prev in Thread] Current Thread [Next in Thread]