fatal lexer errors
David Relson
relson at osagesoftware.com
Thu Sep 4 16:24:25 CEST 2003
Matthias,
The flex compiled parser code uses "#define YY_FATAL_ERROR(msg)
yy_fatal_error(msg)" to output an error message and exit. This behavior
needs to be modified as having bogofilter abort isn't acceptable
behavior.
My first idea was to use something like "fputs(msg, stderr); return
EOF". However YY_FATAL_ERROR is used in functions that don't return
values and functions that return pointers. The different usages
preclude use of any return statement.
If we were using C++, we could use exceptions (throw/catch). However
we're using C. So we have is setjmp/longjmp. The attached patch does
the job.
What d'ya think?
David
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.yy_fatal_error.0904.txt
URL: <https://www.bogofilter.org/pipermail/bogofilter-dev/attachments/20030904/10d642bd/attachment.txt>
More information about the bogofilter-dev
mailing list