bug-gnulib
[Top][All Lists]
Advanced

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

Re: Fwd: suggested feature: "date --debug" - print date parsing diagnost


From: Paul Eggert
Subject: Re: Fwd: suggested feature: "date --debug" - print date parsing diagnostics
Date: Tue, 9 Aug 2016 09:32:25 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Thanks for taking this on. Some comments.

These days, there's little reason to use macros instead of static functions. So I suggest renaming DEBUG0 to debug0 and making it a static function, and similarly for the other macros.

Also, the debug function should call gettext, instead of having its caller do it. That'll make the program a bit smaller. E.g., instead of this:

DEBUG_PRINT_RELATIVE_TIME (_("hybrid"), pc);

do this:

debug_print_relative_time ("hybrid", pc);

and have debug_print_relative_time call gettext.

Come to think of it, should we even be translating the debugging output at all? It's unlikely to be useful to anybody lacking access to the source code, which is in English. Plus, some of the strings are not being translated anyway, for alignment reasons.

debug_stfdatetime can use nstrftime (in the strftime module) instead of doing things by hand. nstrftime deals with time zones and nanoseconds and should be well-behaved with unusual time stamps.

parse-datetime should really be made reentrant, on systems that support that, by using the time_rz module. This is a larger task, though, and can be deferred.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]