Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4FEF111B89 for ; Sun, 1 Jun 2014 01:54:12 +0000 (UTC) Received: (qmail 70759 invoked by uid 500); 1 Jun 2014 01:54:12 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 70709 invoked by uid 500); 1 Jun 2014 01:54:12 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 70702 invoked by uid 99); 1 Jun 2014 01:54:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jun 2014 01:54:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [66.111.4.25] (HELO out1-smtp.messagingengine.com) (66.111.4.25) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jun 2014 01:54:07 +0000 Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id D57F521057; Sat, 31 May 2014 21:53:45 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sat, 31 May 2014 21:53:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=mesmtp; bh= eI0gNm+Ni1Ksmx6tB0sVv9KUmcI=; b=ay9dRcgNEtj85vd544jVBzRP0+OdgWTI JymQQXGQFSTFmvb3HjhgPruFJMeWcn77/z69z5q6NAxW+C/ARj1sC68grUZ+ZTfj /AAk+riImctOQ9ApD6qa7HW8kyPDFf4zaY2RJg/oCofWsHBQTdsnC8NVzaScgodR laX7B2EqAFc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=eI0gNm+Ni1Ksmx6tB0sVv9KUmcI=; b=huGPcjQpc2mb7SFsojkvn0TCmhes fGSzDXIQp7KWXt0D8IvvyS0Jy2wwWqXmMRykHpuPaIHm8UfDawFXlY0IUwvMQwq7 WVmEAOR8tcGLDedGSwCUGZPjkxOG+om0HOaCMJl+ZHCWH/aSnpcKTXHOxa2JDq/X yF+KP6DQe5G9Dp0= X-Sasl-enc: yn4t4r0tyY9UsDqB8QBx4y7ZYsJFec9VuloVuo/X2nqj 1401587625 Received: from tarsus.local2 (unknown [46.19.33.46]) by mail.messagingengine.com (Postfix) with ESMTPA id A6DD9C00005; Sat, 31 May 2014 21:53:41 -0400 (EDT) Date: Sun, 1 Jun 2014 01:53:24 +0000 From: Daniel Shahaf To: Andreas Stieger Cc: dev@subversion.apache.org Subject: Re: [PATCH] Fix xgettext warnings and incomplete format strings due to macros Message-ID: <20140601015324.GA2052@tarsus.local2> References: <538A50FB.9030500@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538A50FB.9030500@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Checked: Checked by ClamAV on apache.org > Index: subversion/libsvn_fs_fs/cached_data.c > =================================================================== > --- subversion/libsvn_fs_fs/cached_data.c (revision 1598897) > +++ subversion/libsvn_fs_fs/cached_data.c (working copy) > @@ -941,9 +941,10 @@ svn_fs_fs__check_rep(representation_t *rep, > || entry->type < SVN_FS_FS__ITEM_TYPE_FILE_REP > || entry->type > SVN_FS_FS__ITEM_TYPE_DIR_PROPS) > return svn_error_createf(SVN_ERR_REPOS_CORRUPTED, NULL, > - _("No representation found at offset %s " > - "for item %" APR_UINT64_T_FMT > - " in revision %ld"), > + apr_psprintf(pool, > + _("No representation found at offset %%s " > + "for item %%%s in revision %%ld"), > + APR_UINT64_T_FMT), > apr_off_t_toa(pool, offset), > rep->item_index, rep->revision); > Don't we prefer doing: svn_error_createf(SVN_ERR_BASE, NULL, _("%s: number %ld"), apr_psprintf(pool, "%" APR_UINT64_T_FMT, (apr_uint64_t)1), 1L) since it allows for compile-time type checking of varargs against the format string? > Index: subversion/libsvn_fs_fs/index.c > =================================================================== > --- subversion/libsvn_fs_fs/index.c (revision 1598897) > +++ subversion/libsvn_fs_fs/index.c (working copy) > l2p_page_info_copy(l2p_page_info_baton_t *baton, > const l2p_header_t *header, > const l2p_page_table_entry_t *page_table, > - const apr_size_t *page_table_index) > + const apr_size_t *page_table_index, > + apr_pool_t *pool) > { > /* revision offset within the index file */ > apr_size_t rel_revision = baton->revision - header->first_revision; > @@ -932,9 +936,10 @@ l2p_page_info_copy(l2p_page_info_baton_t *baton, > * (last_entry - first_entry); > if (baton->item_index >= max_item_index) > return svn_error_createf(SVN_ERR_FS_ITEM_INDEX_OVERFLOW , NULL, > - _("Item index %" APR_UINT64_T_FMT > - " exceeds l2p limit of %" APR_UINT64_T_FMT > - " for revision %ld"), > + apr_psprintf(pool, > + _("Item index %%%s exceeds l2p limit " > + "of %%%s for revision %%ld"), > + APR_UINT64_T_FMT, APR_UINT64_T_FMT), > baton->item_index, max_item_index, > baton->revision); > > @@ -970,7 +975,7 @@ l2p_page_info_access_func(void **out, > (const void *const *)&header->page_table_index); > > /* copy the info */ > - return l2p_page_info_copy(baton, header, page_table, page_table_index); > + return l2p_page_info_copy(baton, header, page_table, page_table_index, result_pool); That should be scratch_pool, since you only use it to allocate an error message. (The svn_error_t->message member is constructed in the error's pool, which is the child of a global pool, not related to any of the pools in this scope.) Thanks, Daniel