bug-coreutils
[Top][All Lists]
Advanced

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

Re: Simplifying command line parsing with Genparse


From: Michael Geng
Subject: Re: Simplifying command line parsing with Genparse
Date: Sat, 16 Jun 2007 19:23:09 +0200
User-agent: Mutt/1.5.9i

On Thu, Jun 07, 2007 at 02:44:38PM +0200, Jim Meyering wrote:
> However, before I even consider it seriously, it'll need
> some improvements:
> 
>   - it must detect any and all write failures[*]

I just added a new release of genparse 
(http://sourceforge.net/project/showfiles.php?group_id=4341&package_id=4354&release_id=516584)
which now also checks file write and close operations, not only
file open operations as it was before.

>   - packaging so that I can run ./configure && make && make check, and
>       if I don't happen to have cppunit infrastructure, gcj or something
>       similar, it should tell me about it directly, rather than causing
>       harder-to-diagnose build failures.

I went through all these tools and updated configure.ac (and related files)
such that you get a warning if something is missing but you can still
compile genparse. For example if you don't have gcj installed then it 
automatically removes the java example from the list of build targets.
It now checks for cunit, cppunit, junit, gcj, doxygen, texi2html, texi2pdf 
and man2html.

>   - one of the generated .c files I looked at calls strdup but doesn't
>       check for a NULL return value or (less important) attempt to avoid
>       the leak when the corresponding --backup=S option appears twice or more.

I'm working on that and I'll let you know when this is finished.

>   - not exactly essential, but highly recommended: it should work
>       with the latest autoconf and automake

I'm using autoconf version 2.59 and automake 1.9.5. Aditionally I renamed 
configure.in to configure.ac which appears to be the standard today and 
removed acconfig.h because it appears to be deprecated. This might have
produced some warnings before. 

> [*] with genparse-0.6.3, I get this:
> 
>   $ strace -o log -e write ./genparse -o /full/tmp/foo ../examples/ls.gp \
>     && echo exit status 0
>   creating /full/tmp/foo.h...done
>   creating /full/tmp/foo.c...done
>   exit status 0
>   $ tail -2 log
>   write(3, "/*******************************"..., 80) = -1 ENOSPC (No space 
> left on device)
>   write(1, "creating /full/tmp/foo.c...done\n", 32) = 32
> 
> The two files it claims to have created are both empty,
> and genparse exited successfully.
> This means genparse is not detecting write or close failures.
> 
> Note that in the example above, /full/tmp is a full file system that still
> has free inodes, so open can create new files, but writes always fail.

I could verify this behavior and I hope it's fixed now. Now it tells you
that it can't write to the file and returns with a non zero exit status.

Thanks again for your input,
Michael




reply via email to

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