bug-bison
[Top][All Lists]
Advanced

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

Re: [PATCH] build: avoid printf format mismatch warnings


From: Eric Blake
Subject: Re: [PATCH] build: avoid printf format mismatch warnings
Date: Tue, 29 Sep 2009 14:30:18 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Joel E. Denny <jdenny <at> clemson.edu> writes:

> Because Sbitset__index is a size_t, wouldn't the following patch be 
> better?
> 
> -  fprintf (file, "nbits = %d, set = {", nbits);
> +  fprintf (file,
> +           "nbits = %" SBITSET__INDEX__CONVERSION_SPEC ", set = {",
> +           nbits);
> 
>  typedef char *Sbitset;
>  typedef size_t Sbitset__Index;
> +#define SBITSET__INDEX__CONVERSION_SPEC "zu"

For this to work on all platforms, you need the gnulib module fprintf-posix 
(sadly, %zu is not completely portable yet).

-- 
Eric Blake







reply via email to

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