|
From: William F. D. <wil...@th...> - 2005-01-25 14:30:59
|
On Tue, 2005-01-25 at 03:11, Martin Quinson wrote:
>
> I was reading the changes by curiosity mainly, and I have some questions.
> (plus an extra changelog entry: do not use the "new" identifier since it
> breaks in C++ ;)
>
> +enum {flexml_max_err_msg_size = 512};
>
> Why is flexml_max_err_msg_size an enum and not a const int? I understand
> that it makes very little difference, but I would find the latter cleaner,
> wouldn't it?
Just a habit of coding style consistent with local (where I work) code
standard, historically arising from the need for the "enum hack" when
using older C++ compilers. See Scott Meyers on this quoted at
http://www.geocities.com/lgol27/CPlusPlus.htm. (That's an answer, not a
justification -- const int would be better. So feel free to change it if
you want.)
> +static char flexml_err_msg[flexml_max_err_msg_size];
> +const char * parse_err_msg()
> +{
> + return flexml_err_msg;
> +}
> +
> +static void reset_parse_err_msg()
> +{
> + flexml_err_msg[0] = '\0';
> +}
>
> Would it be possible to create some sort of option somewhere stating whether
> we're going to display the errors as some as they appear (former behaviour)
> or if we put them into this mecanism, expecting the user to pool it from
> there ?
>
> Or, more precisely, do we want to do so (since I know how to do so ;)?
As an option it would be OK. My bias is toward writing library code, so
I would prefer if the default was silence (not writing to stderr). You
don't want your library writing to stderr -- that would make it less
general and harder to document.
Cheers,
Will
--
William F. Dowling
Thomson/ISI (www.isinet.com)
215-386-0100 x-1156
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
|