RE: Potential bug with my --synclines

Laura Wills <[email protected]>
Newsgroups gmane.comp.gnu.m4.bugs
Message-ID <SN6PR15MB24968EA2F2F8314CF3B52FE581170@SN6PR15MB2496.namprd15.prod.outlook.com>
Eric, 

Do you mind if I ask you another question, while I am putting together the testcase?

I am writing a tool which grabs all different macro options in the m4 file and then runs a test on each of the possible results. Is there a way for me to do this? It can be a parser or an API - or it can just be a simple command that returns all macros in the design. 

Here is a quick example ... 

ifelse(FLTVAR_VIEW_lyco_acc_grp7,
        rtl_gb,
        $file1

        ifelse(FLTVAR_VIEW_common,
                skip,
                ,
                $file2
        )
        
        ifelse(FLTVAR_VIEW_eig_common,
                skip,
                ,
                $file3
        )

I am looking to have FLTVAR_VIEW_lyco_acc_grp7=rtl_gb, FLTVAR_VIEW_common=skip, and FLTVAR_VIEW_eig_common=skip returned to me, so  I can run m4 (or m4 --synclines) for each of these possibilities. 

Thanks,
Laura 
        


-----Original Message-----
From: Eric Blake <[email protected]> 
Sent: Thursday, June 6, 2019 3:46 PM
To: Laura Wills <[email protected]>; [email protected]
Subject: Re: Potential bug with my --synclines

On 6/6/19 2:47 PM, Laura Wills wrote:
> Hi,
> 
> I am running into an issue with m4 synclines. I have a list of m4 files which point to child m4 files. This reaches a hierarchy level of 12. When I write out a list of these m4 files and one at a time read them with m4 synclines I am able to read them without an issue. When I put this into a recursive loop at some point m4 synclines stops returning any value. The return code does show that an error is occurring, but I cannot determine what the issue is. I have tried the different -debug options, and have had no luck.
> 
> In the recursive function I am getting a list of all included m4 files at the current level, writing them to a file, and then closing that file. Once the file is closed, I recursively call the function on the new list of m4 files.  I am using perl `m4 -synclines $infile > $output`.

Can you post actual contents of (a reduced) $infile that reproduce the problem? The issue doesn't sound familiar, but I cannot decipher your prose into a reproducible case nearly as fast as I could inspect your input files to see if there was an obvious problem either in your input files or in m4 itself.

> 
> The version of m4 I am using is 1.4.13. I am running on RHEL6.
> 
> Is this a known issue?
> 
> Thanks,
> Laura
> 
> 

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.