GNU m4 people,

When invoking m4 if you specify a file that does not exist
the return code when exiting is still 0 but you have an error
message.  The man page shows that you will exit with 0
only if there are no errors.  I am using version 1.4.3
compiled from source.

Example (no file bogus.m4 exists, using bash 3.0):

m4 bogus.m4 >bogus
if (($?!=0))
then
  echo error
else
  echo ok
fi

will output this:

m4: bogus.m4: No such file or directory
ok

It should output this:

m4: bogus.m4: No such file or directory
error

From the man page:
"EXIT STATUS
       The following exit values shall be returned:

        0     Successful completion.

       >0     An error occurred"

I could not find what the exit status should be in the
info file at all; searching only turned up hits for
sysval related things and m4exit, neither of which
tells what m4 will return when it has an error.

If a missing file generates a message but is not an error,
then this should be either documented or fixed.

The README file says send bugs to [EMAIL PROTECTED],
but the web page here http://www.seindal.dk/rene/gnu/feedback.htm
says send them to [email protected]

I sent it to both places to be sure.  I hope at least one
of the addresses was the correct place to send this bug report.

Thank you,

JGH



_______________________________________________
Bug-m4 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-m4

Reply via email to