On 08/11/2011 08:25 PM, Dhaval Giani wrote: > On Thu, Aug 11, 2011 at 9:02 AM, Jan Safranek <jsafr...@redhat.com> wrote: >> The error macro should stop all processing, otherwise some NULL pointers >> might >> get dereferenced (e.g. lex.c:1323). >> > > We do not want an exit sicne its part of the library. We want some > non-fatal way out of processing.
I had an impression that we call exit() somewhere else too, at least rpmlint complains to me regularly, but I cannot find it now. I guess rpmlint is wrong... Anyway, any other suggestion? YY_FATAL_ERROR *must* stop other processing, otherwise we get sigsegv, which is IMHO worse than exit(). > >> Signed-off-by: Jan Safranek <jsafr...@redhat.com> >> --- >> >> src/lex.l | 3 ++- >> 1 files changed, 2 insertions(+), 1 deletions(-) >> >> diff --git a/src/lex.l b/src/lex.l >> index 8a99bbc..1cd61ce 100644 >> --- a/src/lex.l >> +++ b/src/lex.l >> @@ -18,7 +18,8 @@ >> #include "parse.h" >> int line_no = 1; >> >> -#define YY_FATAL_ERROR(msg) fprintf(stderr, "%s\n", msg) >> +#define YY_FATAL_ERROR(msg) \ >> + do { fprintf(stderr, "%s\n", msg); exit(1); } while(0); >> %} >> >> %option nounput noinput >> >> >> ------------------------------------------------------------------------------ >> Get a FREE DOWNLOAD! and learn more about uberSVN rich system, >> user administration capabilities and model configuration. Take >> the hassle out of deploying and managing Subversion and the >> tools developers use with it. >> http://p.sf.net/sfu/wandisco-dev2dev >> _______________________________________________ >> Libcg-devel mailing list >> Libcg-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/libcg-devel >> ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel