[PATCH 1 of 2] parsers: remove warning: format ‘%ld’ expects argument of type ‘long int’

André Sintzoff andre.sintzoff at gmail.com
Thu Apr 18 13:33:15 CDT 2013


# HG changeset patch
# User André Sintzoff <andre.sintzoff at gmail.com>
# Date 1366309718 -7200
#      Jeu avr 18 20:28:38 2013 +0200
# Node ID 3a57c20af0527025bf5ffefd6f5dbd6e0b4fcd94
# Parent  7d31f2e42a8afb54c8fae87e8e3e29a63578aea4
parsers: remove warning: format ‘%ld’ expects argument of type ‘long int’

gcc 4.6.3 on 12.04 Ubuntu machine emits warnings:
mercurial/parsers.c: In function ‘find_deepest’:
mercurial/parsers.c:1288:9: warning: format ‘%ld’ expects argument of type
                    ‘long int’, but argument 3 has type ‘Py_ssize_t’ [-Wformat]
mercurial/parsers.c:1288:9: warning: format ‘%ld’ expects argument of type
                    ‘long int’, but argument 4 has type ‘Py_ssize_t’ [-Wformat]

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -1284,7 +1284,7 @@
 
 	if (revcount > capacity) {
 		PyErr_Format(PyExc_OverflowError,
-			     "bitset size (%ld) > capacity (%ld)",
+			     "bitset size (%zd) > capacity (%zd)",
 			     revcount, capacity);
 		return NULL;
 	}


More information about the Mercurial-devel mailing list