RE: [xml] Problems with error printing



Sorry, 

Most of the fprintf are under some sort of #ifdef.
Some of them are under #ifdef LIBXML_OUTPUT_ENABLED. I didn't understand
its documentation in xmlVersion.h as having something to do with dumps
to stderr.
However here are some examples that are not under #ifdef:
xmlregexp.c(2234):     fprintf(stderr, "exec save: allocation failed");
relaxng.c(7768):        fprintf(stderr, "callback on %s missing
info\n",...
I tried to undef LIBXML_OUTPUT_ENABLED in xmlVersion.h but that resulted
in compilation errors.
Example: 
xmlwriter.c(222) 'xmlOutputBufferCreateFilename' undefined (all its
definitions are under #ifdef LIBXML_OUTPUT_ENABLED).
There are some printf's too:
Xmlreader.c(921)        printf("Expand failed !\n");
The examples of code here are by no means a total grep, merely some
examples. 

Ohad

-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com] 
Sent: Monday, February 07, 2005 12:29 PM
To: Ohad Oded
Cc: xml gnome org; Oded Cohen
Subject: Re: [xml] Problems with error printing

On Mon, Feb 07, 2005 at 12:00:51PM +0200, Ohad Oded wrote:
Hi, 

 

In error.c there are functions that handle error printing such as
xmlGenericErrorDefaultFunc, however not all functions use these
methods
for error printing. Some use fprintf(stderr, ...), this is bad for
applications that are GUI oriented and especially bad if stderr is not
initialized.

Some examples:

xpath.c(11135):              fprintf(stderr, "100 x %s\n",
comp->string);

  in #ifdef DEBUG_EVAL_COUNTS i.e. only for debugging

xmlschemas.c(3332):     fprintf(stderr, "  target namespace %s\n",
namespace);

  within #ifdef DEBUG too

xmlreader.c(520):           fprintf(stderr, "xmlTextReader: state %d
depth %d ",

  in #ifdef DEBUG_READER

Can this behavior be fixed? 

  This is not a behaviour. You could not possibly got stderr output from
those unless you modified the sources. So there is nothing to be fixed
and you need to reread that code, doing a basic grep without looking
and complaining without understanding at it is not really a proper way
to get any solution to the problem you may face. If you have *real*
stderr
output, then explain what, the library uses stderr for valid reasons,
it may use it for invalid ones, but your report does not show any.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
**************************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or  the 
sender immediately and do not disclose the contents to anyone or make copies.

** eSafe scanned this email for viruses, vandals and malicious content **
**************************************************************************************************



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