[git] GnuPG - branch, master, updated. gnupg-2.1.5-41-g232af38

by Werner Koch cvs at cvs.gnupg.org
Tue Jun 30 22:31:03 CEST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  232af382e563fcbe15589a3ccae7d6908a17c44d (commit)
      from  e76d4c05b24211f3981ab69cddb3fccc17d21e0e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 232af382e563fcbe15589a3ccae7d6908a17c44d
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jun 30 22:28:41 2015 +0200

    Flag the L_() function with attribute format_arg.
    
    * agent/agent.h (LunderscorePROTO): New.
    * common/util.h (GNUPG_GCC_ATTR_FORMAT_ARG): New.
    * common/i18n.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. Use for
    i18n_localegettext.  Expand LunderscorePROTO.
    * agent/genkey.c (check_passphrase_constraints): Use xtryasprintf
    again to keep the old translations.
    --
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/agent/agent.h b/agent/agent.h
index 70d63cf..2948bff 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -301,6 +301,10 @@ typedef int (*lookup_ttl_t)(const char *hexgrip);
    the connection.  The macro LunderscoreIMPL is used by i18n to
    actually define the inline function when needed.  */
 #define L_(a) agent_Lunderscore (ctrl, (a))
+#define LunderscorePROTO                                            \
+  static inline const char *agent_Lunderscore (ctrl_t ctrl,         \
+                                               const char *string)  \
+    GNUPG_GCC_ATTR_FORMAT_ARG(2);
 #define LunderscoreIMPL                                         \
   static inline const char *                                    \
   agent_Lunderscore (ctrl_t ctrl, const char *string)           \
diff --git a/agent/genkey.c b/agent/genkey.c
index b5dee8e..df17880 100644
--- a/agent/genkey.c
+++ b/agent/genkey.c
@@ -271,8 +271,9 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw,
           goto leave;
         }
 
-      msg3 = xtrystrdup (L_("A passphrase may not be a known term or match%0A"
-                            "certain pattern."));
+      msg3 = xtryasprintf
+        (L_("A passphrase may not be a known term or match%%0A"
+            "certain pattern."));
       if (!msg3)
         {
           err = gpg_error_from_syserror ();
diff --git a/common/i18n.h b/common/i18n.h
index 8507b8f..45710b2 100644
--- a/common/i18n.h
+++ b/common/i18n.h
@@ -38,14 +38,24 @@
 # endif
 #endif /*!USE_SIMPLE_GETTEXT*/
 
+#ifndef GNUPG_GCC_ATTR_FORMAT_ARG
+#if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier.  */
+# define GNUPG_GCC_ATTR_FORMAT_ARG(a)  __attribute__ ((__format_arg__ (a)))
+#else
+# define GNUPG_GCC_ATTR_FORMAT_ARG(a)
+#endif
+#endif
+
 void i18n_init (void);
 char *i18n_switchto_utf8 (void);
 void i18n_switchback (char *saved_codeset);
 const char *i18n_utf8 (const char *string);
-const char *i18n_localegettext (const char *lc_messages, const char *string);
+const char *i18n_localegettext (const char *lc_messages, const char *string)
+                                GNUPG_GCC_ATTR_FORMAT_ARG(2);
 
 /* If a module wants a local L_() fucntion we define it here.  */
 #ifdef LunderscoreIMPL
+LunderscorePROTO
 LunderscoreIMPL
 #endif
 
diff --git a/common/util.h b/common/util.h
index d5ddc1f..b92d78c 100644
--- a/common/util.h
+++ b/common/util.h
@@ -153,6 +153,14 @@
 
 
 /* GCC attributes.  */
+#ifndef GNUPG_GCC_ATTR_FORMAT_ARG
+#if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier.  */
+# define GNUPG_GCC_ATTR_FORMAT_ARG(a)  __attribute__ ((__format_arg__ (a)))
+#else
+# define GNUPG_GCC_ATTR_FORMAT_ARG(a)
+#endif
+#endif
+
 #if __GNUC__ >= 4
 # define GNUPG_GCC_A_SENTINEL(a) __attribute__ ((sentinel(a)))
 #else

-----------------------------------------------------------------------

Summary of changes:
 agent/agent.h  |  4 ++++
 agent/genkey.c |  5 +++--
 common/i18n.h  | 12 +++++++++++-
 common/util.h  |  8 ++++++++
 4 files changed, 26 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list