This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libc-2.25.90.pot


On Wednesday 19 July 2017 06:58 PM, Adhemerval Zanella wrote:
> I think for glibc, since we support C99 intmax_t printf format, we can
> just use %jd instead:
> 
> 	* timezone/zic.c (PRIdLINENO): Remove macro.
> 	(verror): Use %jd instead of PRIdLINENO.

Fine with me, but I'd like to hear from Joseph/Paul too if they have any
context from the tz project that may make this a bad idea.

Siddhesh

> ---
>  ChangeLog      | 5 +++++
>  timezone/zic.c | 7 +++----
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/timezone/zic.c b/timezone/zic.c
> index 068fb43..aaef06b 100644
> --- a/timezone/zic.c
> +++ b/timezone/zic.c
> @@ -48,7 +48,6 @@ static ptrdiff_t const PTRDIFF_MAX = MAXVAL(ptrdiff_t, TYPE_BIT(ptrdiff_t));
>  
>  /* The type and printf format for line numbers.  */
>  typedef intmax_t lineno;
> -#define PRIdLINENO PRIdMAX
>  
>  struct rule {
>  	const char *	r_filename;
> @@ -484,10 +483,10 @@ verror(const char *const string, va_list args)
>  	** on BSD systems.
>  	*/
>  	if (filename)
> -	  fprintf(stderr, _("\"%s\", line %"PRIdLINENO": "), filename, linenum);
> +	  fprintf(stderr, _("\"%s\", line %jd: "), filename, linenum);
>  	vfprintf(stderr, string, args);
>  	if (rfilename != NULL)
> -		fprintf(stderr, _(" (rule from \"%s\", line %"PRIdLINENO")"),
> +		fprintf(stderr, _(" (rule from \"%s\", line %jd)"),
>  			rfilename, rlinenum);
>  	fprintf(stderr, "\n");
>  }
> @@ -1250,7 +1249,7 @@ _("\"Zone %s\" line and -p option are mutually exclusive"),
>  		if (zones[i].z_name != NULL &&
>  			strcmp(zones[i].z_name, fields[ZF_NAME]) == 0) {
>  				error(_("duplicate zone name %s"
> -					" (file \"%s\", line %"PRIdLINENO")"),
> +					" (file \"%s\", line %jd)"),
>  					fields[ZF_NAME],
>  					zones[i].z_filename,
>  					zones[i].z_linenum);
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]