Fix tst-ftell-active-handler.c warning
diff mbox

Message ID alpine.DEB.2.10.1412101543150.32166@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers Dec. 10, 2014, 3:43 p.m. UTC
A recent change to libio/tst-ftell-active-handler.c (postdating my
last check for warnings on x86) introduced a format warning from a
long int variable used with a %zu format.  This patch fixes it by
using %ld for the format to match the variable.

Tested for x86.

2014-12-10  Joseph Myers  <joseph@codesourcery.com>

	* libio/tst-ftell-active-handler.c (do_ftruncate_test): Use %ld
	format for long int variable.

Comments

Ondřej Bílka Dec. 10, 2014, 4:02 p.m. UTC | #1
On Wed, Dec 10, 2014 at 03:43:44PM +0000, Joseph Myers wrote:
> A recent change to libio/tst-ftell-active-handler.c (postdating my
> last check for warnings on x86) introduced a format warning from a
> long int variable used with a %zu format.  This patch fixes it by
> using %ld for the format to match the variable.
> 
> Tested for x86.
>
ok 

> 2014-12-10  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* libio/tst-ftell-active-handler.c (do_ftruncate_test): Use %ld
> 	format for long int variable.
> 
> diff --git a/libio/tst-ftell-active-handler.c b/libio/tst-ftell-active-handler.c
> index 6151554..7be75bc 100644
> --- a/libio/tst-ftell-active-handler.c
> +++ b/libio/tst-ftell-active-handler.c
> @@ -165,7 +165,7 @@ do_ftruncate_test (const char *filename)
>  	     it.  */
>  	  if (offset != new_offset)
>  	    {
> -	      printf ("Incorrect offset.  Expected %zu, but got %ld\n",
> +	      printf ("Incorrect offset.  Expected %ld, but got %ld\n",
>  		      offset, new_offset);
>  
>  	      ret |= 1;
> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com

Patch
diff mbox

diff --git a/libio/tst-ftell-active-handler.c b/libio/tst-ftell-active-handler.c
index 6151554..7be75bc 100644
--- a/libio/tst-ftell-active-handler.c
+++ b/libio/tst-ftell-active-handler.c
@@ -165,7 +165,7 @@  do_ftruncate_test (const char *filename)
 	     it.  */
 	  if (offset != new_offset)
 	    {
-	      printf ("Incorrect offset.  Expected %zu, but got %ld\n",
+	      printf ("Incorrect offset.  Expected %ld, but got %ld\n",
 		      offset, new_offset);
 
 	      ret |= 1;