Email List: Xaustin-review-lX
[All Lists]

Defect in XCU m4

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XCU m4
From: yyyyyyy@xxxxxxx
Date: Wed, 17 Apr 2002 10:51:03 +0100 (BST)
        Defect report from : Joanna Farley , Sun Microsystems

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 2581 line 22337-22361 section m4 objection {Sun-jf-dc5}

Problem:

Defect code :  1. Error

We have found several problems in the examples on the m4 page in XCU4,
XCU4v2, XCU5 and XCU6.

Specifically, there is no "if" built-in macro in m4 and there is no 
"ifndef" built-in macro in m4.  There is also a problem in that none 
of the examples show what would be produced by m4 and using make in 
the examples obfuscates the use of m4.

The use of an unquoted macro name in the ifndef() macro call is 
confusing if the reader has read the description of how m4 expands 
macros.  (We won't say it is wrong only because the examples don't 
specify the output that would be produced.)

Action:

Replace the entire EXAMPLES section in XCU6, P2581, L22337-22361 
with the following (Note that all double quotes, grave accents, and 
accute accents in the following must remain as those characters.  
In this context the pairs of acute and grave accents are very 
different from opening and closing double quotes.  The blank lines 
in the example output sections are also VERY important.):


If the file \fBm4input\fP contains the lines:
        The value of `VER' is "VER".
        ifdef(`VER', ``VER'' is defined to be VER., VER is not defined.)
        ifelse(VER, 1, ``VER'' is `VER'.)
        ifelse(VER, 2, ``VER'' is `VER'., ``VER'' is not 2.)
        end
then the command:
        m4 m4src
or the command:
        m4 -U VER m4src
produces the output:
        The value of VER is "VER".
        VER is not defined.

        VER is not 2.
        end

The commnd:
        m4 -D VER m4src
produces the output:
        The value of VER is "".
        VER is defined to be .

        VER is not 2.
        end

The command:
        m4 -D VER=1 m4src
produces the output:
        The value of VER is "1".
        VER is defined to be 1.
        VER is 1.
        VER is not 2.
        end

The command:
        m4 -D VER=2 m4src
produces the output:
        The value of VER is "2".
        VER is defined to be 2.

        VER is 2.
        end


<Prev in Thread] Current Thread [Next in Thread>