[git] Pinentry - branch, master, updated. pinentry-0.9.3-4-gee23924

by Werner Koch cvs at cvs.gnupg.org
Tue Jun 2 11:38:37 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 standard pinentry collection".

The branch, master has been updated
       via  ee23924390a45700b35ab37a75278cfeb965b8c8 (commit)
       via  f74e40465f979749af6df5b9ea325324a428a669 (commit)
       via  87e6811f2d1e72c501d14670ad911245a41c0828 (commit)
      from  ec2bee55f9d533db4ad4357f18ee8cb6b7f29758 (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 ee23924390a45700b35ab37a75278cfeb965b8c8
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jun 2 11:36:36 2015 +0200

    Fixed compiler warnings - mostly unused parameter.

diff --git a/assuan/assuan-handler.c b/assuan/assuan-handler.c
index 947ab9d..aadad21 100644
--- a/assuan/assuan-handler.c
+++ b/assuan/assuan-handler.c
@@ -1,4 +1,4 @@
-/* assuan-handler.c - dispatch commands 
+/* assuan-handler.c - dispatch commands
  *	Copyright (C) 2001 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
@@ -32,6 +32,7 @@
 static int
 dummy_handler (ASSUAN_CONTEXT ctx, char *line)
 {
+  (void)line;
   return set_error (ctx, Server_Fault, "no handler registered");
 }
 
@@ -39,15 +40,18 @@ dummy_handler (ASSUAN_CONTEXT ctx, char *line)
 static int
 std_handler_nop (ASSUAN_CONTEXT ctx, char *line)
 {
+  (void)ctx;
+  (void)line;
   return 0; /* okay */
 }
-  
+
 static int
 std_handler_cancel (ASSUAN_CONTEXT ctx, char *line)
 {
+  (void)line;
   if (ctx->cancel_notify_fnc)
     ctx->cancel_notify_fnc (ctx);
-  return set_error (ctx, Not_Implemented, NULL); 
+  return set_error (ctx, Not_Implemented, NULL);
 }
 
 static int
@@ -96,37 +100,41 @@ std_handler_option (ASSUAN_CONTEXT ctx, char *line)
     return ctx->option_handler_fnc (ctx, key, value);
   return 0;
 }
-  
+
 static int
 std_handler_bye (ASSUAN_CONTEXT ctx, char *line)
 {
+  (void)line;
   if (ctx->bye_notify_fnc)
     ctx->bye_notify_fnc (ctx);
   assuan_close_input_fd (ctx);
   assuan_close_output_fd (ctx);
   return -1; /* pretty simple :-) */
 }
-  
+
 static int
 std_handler_auth (ASSUAN_CONTEXT ctx, char *line)
 {
-  return set_error (ctx, Not_Implemented, NULL); 
+  (void)line;
+  return set_error (ctx, Not_Implemented, NULL);
 }
-  
+
 static int
 std_handler_reset (ASSUAN_CONTEXT ctx, char *line)
 {
+  (void)line;
   if (ctx->reset_notify_fnc)
     ctx->reset_notify_fnc (ctx);
   assuan_close_input_fd (ctx);
   assuan_close_output_fd (ctx);
   return 0;
 }
-  
+
 static int
 std_handler_end (ASSUAN_CONTEXT ctx, char *line)
 {
-  return set_error (ctx, Not_Implemented, NULL); 
+  (void)line;
+  return set_error (ctx, Not_Implemented, NULL);
 }
 
 static int
@@ -182,7 +190,7 @@ std_handler_output (ASSUAN_CONTEXT ctx, char *line)
 
 
 
-  
+
 
 /* This is a table with the standard commands and handler for them.
    The table is used to initialize a new context and assuciate strings
@@ -214,13 +222,13 @@ static struct {
  * @cmd_id: An ID value for the command
  * @cmd_name: A string with the command name
  * @handler: The handler function to be called
- * 
+ *
  * Register a handler to be used for a given command.
- * 
+ *
  * The @cmd_name must be %NULL or an empty string for all @cmd_ids
  * below %ASSUAN_CMD_USER because predefined values are used.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 int
 assuan_register_command (ASSUAN_CONTEXT ctx,
@@ -233,7 +241,7 @@ assuan_register_command (ASSUAN_CONTEXT ctx,
     cmd_name = NULL;
 
   if (cmd_id < ASSUAN_CMD_USER)
-    { 
+    {
       if (cmd_name)
         return ASSUAN_Invalid_Value; /* must be NULL for these values*/
 
@@ -250,7 +258,7 @@ assuan_register_command (ASSUAN_CONTEXT ctx,
       if (!std_cmd_table[i].name)
         return ASSUAN_Invalid_Value; /* not a pre-registered one */
     }
-  
+
   if (!handler)
     handler = dummy_handler;
 
@@ -359,7 +367,7 @@ _assuan_register_std_commands (ASSUAN_CONTEXT ctx)
           if (rc)
             return rc;
         }
-    } 
+    }
   return 0;
 }
 
@@ -370,6 +378,8 @@ _assuan_register_std_commands (ASSUAN_CONTEXT ctx)
 static int
 handle_data_line (ASSUAN_CONTEXT ctx, char *line, int linelen)
 {
+  (void)line;
+  (void)linelen;
   return set_error (ctx, Not_Implemented, NULL);
 }
 
@@ -391,7 +401,7 @@ my_strcasecmp (const char *a, const char *b)
 /* Parse the line, break out the command, find it in the command
    table, remove leading and white spaces from the arguments, all the
    handler with the argument line and return the error */
-static int 
+static int
 dispatch_command (ASSUAN_CONTEXT ctx, char *line, int linelen)
 {
   char *p;
@@ -404,8 +414,8 @@ dispatch_command (ASSUAN_CONTEXT ctx, char *line, int linelen)
   for (p=line; *p && *p != ' ' && *p != '\t'; p++)
     ;
   if (p==line)
-    return set_error (ctx, Syntax_Error, "leading white-space"); 
-  if (*p) 
+    return set_error (ctx, Syntax_Error, "leading white-space");
+  if (*p)
     { /* Skip over leading WS after the keyword */
       *p++ = 0;
       while ( *p == ' ' || *p == '\t')
@@ -476,11 +486,11 @@ process_request (ASSUAN_CONTEXT ctx)
       rc = assuan_write_line (ctx, ctx->okay_line? ctx->okay_line : "OK");
     }
   else if (rc == -1)
-    { /* No error checking because the peer may have already disconnect */ 
+    { /* No error checking because the peer may have already disconnect */
       assuan_write_line (ctx, "OK closing connection");
       ctx->finish_handler (ctx);
     }
-  else 
+  else
     {
       char errline[256];
 
@@ -509,11 +519,11 @@ process_request (ASSUAN_CONTEXT ctx)
 /**
  * assuan_process:
  * @ctx: assuan context
- * 
+ *
  * This fucntion is used to handle the assuan protocol after a
  * connection has been established using assuan_accept().  This is the
  * main protocol handler.
- * 
+ *
  * Return value: 0 on success or an error code if the assuan operation
  * failed.  Note, that no error is returned for operational errors.
  **/
@@ -536,15 +546,15 @@ assuan_process (ASSUAN_CONTEXT ctx)
 /**
  * assuan_process_next:
  * @ctx: Assuan context
- * 
+ *
  * Same as assuan_process() but the user has to provide the outer
  * loop.  He should loop as long as the return code is zero and stop
  * otherwise; -1 is regular end.
- * 
+ *
  * See also: assuan_get_active_fds()
  * Return value: -1 for end of server, 0 on success or an error code
  **/
-int 
+int
 assuan_process_next (ASSUAN_CONTEXT ctx)
 {
   return process_request (ctx);
@@ -557,18 +567,18 @@ assuan_process_next (ASSUAN_CONTEXT ctx)
  * @what: 0 for read fds, 1 for write fds
  * @fdarray: Caller supplied array to store the FDs
  * @fdarraysize: size of that array
- * 
+ *
  * Return all active filedescriptors for the given context.  This
  * function can be used to select on the fds and call
  * assuan_process_next() if there is an active one.  The first fd in
  * the array is the one used for the command connection.
  *
  * Note, that write FDs are not yet supported.
- * 
+ *
  * Return value: number of FDs active and put into @fdarray or -1 on
  * error which is most likely a too small fdarray.
  **/
-int 
+int
 assuan_get_active_fds (ASSUAN_CONTEXT ctx, int what,
                        int *fdarray, int fdarraysize)
 {
diff --git a/assuan/assuan-pipe-server.c b/assuan/assuan-pipe-server.c
index 07373e1..c0d464f 100644
--- a/assuan/assuan-pipe-server.c
+++ b/assuan/assuan-pipe-server.c
@@ -1,4 +1,4 @@
-/* assuan-pipe-server.c - Assuan server working over a pipe 
+/* assuan-pipe-server.c - Assuan server working over a pipe
  *	Copyright (C) 2001 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
@@ -27,12 +27,14 @@
 static void
 deinit_pipe_server (ASSUAN_CONTEXT ctx)
 {
+  (void)ctx;
   /* nothing to do for this simple server */
 }
 
 static int
 accept_connection (ASSUAN_CONTEXT ctx)
 {
+  (void)ctx;
   /* This is a NOP for a pipe server */
   return 0;
 }
@@ -40,6 +42,7 @@ accept_connection (ASSUAN_CONTEXT ctx)
 static int
 finish_connection (ASSUAN_CONTEXT ctx)
 {
+  (void)ctx;
   /* This is a NOP for a pipe server */
   return 0;
 }
diff --git a/configure.ac b/configure.ac
index 88bc00b..c453e45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -169,7 +169,7 @@ if test "$GCC" = yes; then
           CFLAGS=$_gcc_cflags_save;
         fi
         if test x"$_gcc_warn" = xyes ; then
-          CFLAGS="$CFLAGS -W -Wno-missing-field-initializers"
+          CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
         fi
 
         AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
diff --git a/gtk+-2/gtksecentry.c b/gtk+-2/gtksecentry.c
index 10f41c3..112d7c2 100644
--- a/gtk+-2/gtksecentry.c
+++ b/gtk+-2/gtksecentry.c
@@ -1350,6 +1350,8 @@ gtk_secure_entry_focus_in(GtkWidget * widget, GdkEventFocus * event)
 {
     GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget);
 
+    (void)event;
+
     gtk_widget_queue_draw(widget);
 
     entry->need_im_reset = TRUE;
@@ -1370,6 +1372,8 @@ gtk_secure_entry_focus_out(GtkWidget * widget, GdkEventFocus * event)
 {
     GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget);
 
+    (void)event;
+
     gtk_widget_queue_draw(widget);
 
     entry->need_im_reset = TRUE;
@@ -1423,6 +1427,8 @@ gtk_secure_entry_state_changed(GtkWidget * widget,
 {
     GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget);
 
+    (void)previous_state;
+
     if (GTK_WIDGET_REALIZED(widget)) {
 	gdk_window_set_background(widget->window,
 				  &widget->style->
@@ -1444,6 +1450,8 @@ gtk_secure_entry_state_changed(GtkWidget * widget,
 static void
 gtk_secure_entry_screen_changed(GtkWidget * widget, GdkScreen * old_screen)
 {
+    (void)old_screen;
+
     gtk_secure_entry_recompute(GTK_SECURE_ENTRY(widget));
 }
 
@@ -1575,6 +1583,8 @@ gtk_secure_entry_style_set(GtkWidget * widget, GtkStyle * previous_style)
 static void
 gtk_cell_editable_secure_entry_activated(GtkSecureEntry * entry, gpointer data)
 {
+    (void)data;
+
     gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(entry));
     gtk_cell_editable_remove_widget(GTK_CELL_EDITABLE(entry));
 }
@@ -1583,6 +1593,8 @@ static gboolean
 gtk_cell_editable_key_press_event(GtkSecureEntry * entry,
 				  GdkEventKey * key_event, gpointer data)
 {
+    (void)data;
+
     if (key_event->keyval == GDK_Escape) {
 	entry->editing_canceled = TRUE;
 	gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(entry));
@@ -1606,6 +1618,8 @@ static void
 gtk_secure_entry_start_editing(GtkCellEditable * cell_editable,
 			       GdkEvent * event)
 {
+    (void)event;
+
     GTK_SECURE_ENTRY(cell_editable)->is_cell_renderer = TRUE;
 
     g_signal_connect(cell_editable, "activate",
@@ -1950,6 +1964,8 @@ paste_received (GtkClipboard *clipboard,
   GtkSecureEntry *entry = GTK_SECURE_ENTRY (data);
   GtkEditable *editable = GTK_EDITABLE (entry);
 
+  (void)clipboard;
+
   if (entry->button == 2)
     {
       gint pos, start, end;
@@ -2043,7 +2059,9 @@ static void
 gtk_secure_entry_keymap_direction_changed(GdkKeymap * keymap,
 					  GtkSecureEntry * entry)
 {
-    gtk_secure_entry_recompute(entry);
+  (void)keymap;
+
+  gtk_secure_entry_recompute(entry);
 }
 
 /* IM Context Callbacks
@@ -2053,7 +2071,9 @@ static void
 gtk_secure_entry_commit_cb(GtkIMContext * context,
 			   const gchar * str, GtkSecureEntry * entry)
 {
-    gtk_secure_entry_enter_text(entry, str);
+  (void)context;
+
+  gtk_secure_entry_enter_text(entry, str);
 }
 
 static void
@@ -2063,6 +2083,8 @@ gtk_secure_entry_preedit_changed_cb(GtkIMContext * context,
     gchar *preedit_string;
     gint cursor_pos;
 
+    (void)context;
+
     gtk_im_context_get_preedit_string(entry->im_context,
 				      &preedit_string, NULL, &cursor_pos);
     entry->preedit_length = strlen(preedit_string);
@@ -2094,6 +2116,8 @@ gtk_secure_entry_delete_surrounding_cb(GtkIMContext * slave,
 				       gint n_chars,
 				       GtkSecureEntry * entry)
 {
+    (void)slave;
+
     gtk_editable_delete_text(GTK_EDITABLE(entry),
 			     entry->current_pos + offset,
 			     entry->current_pos + offset + n_chars);
@@ -3287,6 +3311,8 @@ static gboolean
 gtk_secure_entry_mnemonic_activate(GtkWidget * widget,
 				   gboolean group_cycling)
 {
+    (void)group_cycling;
+
     gtk_widget_grab_focus(widget);
     return TRUE;
 }
@@ -3476,6 +3502,9 @@ _gtk_marshal_VOID__ENUM_INT_BOOLEAN(GClosure * closure,
     register GCClosure *cc = (GCClosure *) closure;
     register gpointer data1, data2;
 
+    (void)return_value;
+    (void)invocation_hint;
+
     g_return_if_fail(n_param_values == 4);
 
     if (G_CCLOSURE_SWAP_DATA(closure)) {
@@ -3511,6 +3540,9 @@ _gtk_marshal_VOID__ENUM_INT(GClosure * closure,
     register GCClosure *cc = (GCClosure *) closure;
     register gpointer data1, data2;
 
+    (void)return_value;
+    (void)invocation_hint;
+
     g_return_if_fail(n_param_values == 3);
 
     if (G_CCLOSURE_SWAP_DATA(closure)) {
diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
index 1a88e5a..1666698 100644
--- a/gtk+-2/pinentry-gtk-2.c
+++ b/gtk+-2/pinentry-gtk-2.c
@@ -93,6 +93,8 @@ constrain_size (GtkWidget *win, GtkRequisition *req, gpointer data)
   static gint width, height;
   GdkGeometry geo;
 
+  (void)data;
+
   if (req->width == width && req->height == height)
     return;
   width = req->width;
@@ -126,6 +128,9 @@ make_transient (GtkWidget *win, GdkEvent *event, gpointer data)
   GdkScreen *screen;
   GdkWindow *root;
 
+  (void)event;
+  (void)data;
+
   if (! pinentry->grab)
     return;
 
@@ -140,6 +145,8 @@ make_transient (GtkWidget *win, GdkEvent *event, gpointer data)
 static int
 grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
 {
+  (void)data;
+
   if (! pinentry->grab)
     return FALSE;
 
@@ -157,6 +164,8 @@ grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
 static int
 ungrab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
 {
+  (void)data;
+
   gdk_keyboard_ungrab (gdk_event_get_time (event));
   /* Unmake window transient for the root window.  */
   /* gdk_window_set_transient_for cannot be used with parent = NULL to
@@ -171,6 +180,10 @@ ungrab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
 static int
 delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
 {
+  (void)widget;
+  (void)event;
+  (void)data;
+
   pinentry->close_button = 1;
   gtk_main_quit ();
   return TRUE;
@@ -180,6 +193,8 @@ delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
 static void
 button_clicked (GtkWidget *widget, gpointer data)
 {
+  (void)widget;
+
   if (data)
     {
       const char *s, *s2;
@@ -218,6 +233,8 @@ button_clicked (GtkWidget *widget, gpointer data)
 static void
 enter_callback (GtkWidget *widget, GtkWidget *anentry)
 {
+  (void)anentry;
+
   button_clicked (widget, (gpointer) CONFIRM_OK);
 }
 
@@ -225,6 +242,8 @@ enter_callback (GtkWidget *widget, GtkWidget *anentry)
 static void
 confirm_button_clicked (GtkWidget *widget, gpointer data)
 {
+  (void)widget;
+
   confirm_value = (confirm_value_t) data;
   gtk_main_quit ();
 }
@@ -236,6 +255,10 @@ cancel_callback (GtkAccelGroup *acc, GObject *accelerable,
 {
   int confirm_mode = !!data;
 
+  (void)acc;
+  (void)keyval;
+  (void)modifier;
+
   if (confirm_mode)
     confirm_button_clicked (GTK_WIDGET (accelerable),
                             (gpointer)CONFIRM_CANCEL);
diff --git a/pinentry/pinentry.c b/pinentry/pinentry.c
index 9a6a090..a0737ad 100644
--- a/pinentry/pinentry.c
+++ b/pinentry/pinentry.c
@@ -168,8 +168,11 @@ pinentry_reset (int use_defaults)
 static void
 pinentry_assuan_reset_handler (ASSUAN_CONTEXT ctx)
 {
+  (void)ctx;
   pinentry_reset (0);
 }
+
+
 
 static int lc_ctype_unknown_warning = 0;
 
@@ -514,8 +517,9 @@ pinentry_init (const char *pgmname)
   drop_privs ();
 
   if (atexit (secmem_term))
-    /* FIXME: Could not register at-exit function, bail out.  */
-    ;
+    {
+      /* FIXME: Could not register at-exit function, bail out.  */
+    }
 
   assuan_set_malloc_hooks (secmem_malloc, secmem_realloc, secmem_free);
 }
@@ -754,6 +758,8 @@ pinentry_parse_opts (int argc, char *argv[])
 static int
 option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value)
 {
+  (void)ctx;
+
   if (!strcmp (key, "no-grab") && !*value)
     pinentry.grab = 0;
   else if (!strcmp (key, "grab") && !*value)
@@ -879,8 +885,10 @@ static int
 cmd_setdesc (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newd;
-  newd = malloc (strlen (line) + 1);
 
+  (void)ctx;
+
+  newd = malloc (strlen (line) + 1);
   if (!newd)
     return ASSUAN_Out_Of_Core;
 
@@ -896,8 +904,10 @@ static int
 cmd_setprompt (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newp;
-  newp = malloc (strlen (line) + 1);
 
+  (void)ctx;
+
+  newp = malloc (strlen (line) + 1);
   if (!newp)
     return ASSUAN_Out_Of_Core;
 
@@ -916,6 +926,8 @@ cmd_setprompt (ASSUAN_CONTEXT ctx, char *line)
 static int
 cmd_setkeyinfo (ASSUAN_CONTEXT ctx, char *line)
 {
+  (void)ctx;
+
   if (pinentry.keyinfo)
     free (pinentry.keyinfo);
 
@@ -933,6 +945,8 @@ cmd_setrepeat (ASSUAN_CONTEXT ctx, char *line)
 {
   char *p;
 
+  (void)ctx;
+
   p = malloc (strlen (line) + 1);
   if (!p)
     return ASSUAN_Out_Of_Core;
@@ -949,6 +963,8 @@ cmd_setrepeaterror (ASSUAN_CONTEXT ctx, char *line)
 {
   char *p;
 
+  (void)ctx;
+
   p = malloc (strlen (line) + 1);
   if (!p)
     return ASSUAN_Out_Of_Core;
@@ -964,8 +980,10 @@ static int
 cmd_seterror (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newe;
-  newe = malloc (strlen (line) + 1);
 
+  (void)ctx;
+
+  newe = malloc (strlen (line) + 1);
   if (!newe)
     return ASSUAN_Out_Of_Core;
 
@@ -981,8 +999,10 @@ static int
 cmd_setok (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newo;
-  newo = malloc (strlen (line) + 1);
 
+  (void)ctx;
+
+  newo = malloc (strlen (line) + 1);
   if (!newo)
     return ASSUAN_Out_Of_Core;
 
@@ -998,8 +1018,10 @@ static int
 cmd_setnotok (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newo;
-  newo = malloc (strlen (line) + 1);
 
+  (void)ctx;
+
+  newo = malloc (strlen (line) + 1);
   if (!newo)
     return ASSUAN_Out_Of_Core;
 
@@ -1015,8 +1037,10 @@ static int
 cmd_setcancel (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newc;
-  newc = malloc (strlen (line) + 1);
 
+  (void)ctx;
+
+  newc = malloc (strlen (line) + 1);
   if (!newc)
     return ASSUAN_Out_Of_Core;
 
@@ -1031,18 +1055,22 @@ cmd_setcancel (ASSUAN_CONTEXT ctx, char *line)
 static int
 cmd_settimeout (ASSUAN_CONTEXT ctx, char *line)
 {
-    if (line && *line)
-	pinentry.timeout = atoi(line);
+  (void)ctx;
 
-    return 0;
+  if (line && *line)
+    pinentry.timeout = atoi (line);
+
+  return 0;
 }
 
 static int
 cmd_settitle (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newt;
-  newt = malloc (strlen (line) + 1);
 
+  (void)ctx;
+
+  newt = malloc (strlen (line) + 1);
   if (!newt)
     return ASSUAN_Out_Of_Core;
 
@@ -1058,6 +1086,8 @@ cmd_setqualitybar (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newval;
 
+  (void)ctx;
+
   if (!*line)
     line = "Quality:";
 
@@ -1078,6 +1108,8 @@ cmd_setqualitybar_tt (ASSUAN_CONTEXT ctx, char *line)
 {
   char *newval;
 
+  (void)ctx;
+
   if (*line)
     {
       newval = malloc (strlen (line) + 1);
@@ -1102,6 +1134,8 @@ cmd_getpin (ASSUAN_CONTEXT ctx, char *line)
   int set_prompt = 0;
   int just_read_password_from_cache = 0;
 
+  (void)line;
+
   pinentry_setbuffer_init (&pinentry);
   if (!pinentry.pin)
     return ASSUAN_Out_Of_Core;
@@ -1268,6 +1302,8 @@ cmd_confirm (ASSUAN_CONTEXT ctx, char *line)
 static int
 cmd_message (ASSUAN_CONTEXT ctx, char *line)
 {
+  (void)line;
+
   return cmd_confirm (ctx, "--one-button");
 }
 
@@ -1309,6 +1345,8 @@ cmd_getinfo (assuan_context_t ctx, char *line)
 static int
 cmd_clear_passphrase (ASSUAN_CONTEXT ctx, char *line)
 {
+  (void)ctx;
+
   if (! line)
     return ASSUAN_Invalid_Value;
 
diff --git a/qt4/secstring.cpp b/qt4/secstring.cpp
index c8b9276..42207be 100644
--- a/qt4/secstring.cpp
+++ b/qt4/secstring.cpp
@@ -1,20 +1,20 @@
-/* 
+/*
    secstring.h - typedefs and conversion for secmem-backed std::strings.
 
    Copyright (C) 2008 Klarälvdalens Datakonsult AB (KDAB)
 
    Written by Marc Mutz <marc at kdab.com>.
-   
+
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of the
    License, or (at your option) any later version.
- 
+
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.
- 
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -68,7 +68,7 @@ secstring toUtf8( const secqstring & str )
     if (const int l = str.size()) {
         int rlen = l*3+1;
         ba.reserve(rlen);
-        uchar *cursor = (uchar*)ba.data();
+        /*uchar *cursor = (uchar*)ba.data();*/
         const QChar *ch = str.data();
         for (int i=0; i < l; i++) {
             uint u = ch->unicode();

commit f74e40465f979749af6df5b9ea325324a428a669
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jun 2 11:19:57 2015 +0200

    Add more GCC warnings flags.
    
    * configure.ac: Add GCC specific -W flags.
    --
    
    Note that --enable-maintainer-mode is required to see all warnings.

diff --git a/configure.ac b/configure.ac
index a66f830..88bc00b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,17 +144,73 @@ AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
 
 dnl Checks for compiler features.
 if test "$GCC" = yes; then
-    CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+    # Check whether gcc does not emit a diagnositc for unknown -Wno-*
+    # options.  This is the case for gcc >= 4.6
+    AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 )
+#kickerror
+#endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no])
+    AC_MSG_RESULT($_gcc_silent_wno)
+
+    if test "$USE_MAINTAINER_MODE" = "yes"; then
+        CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+        CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
+
+        if test x"$_gcc_silent_wno" = xyes ; then
+          _gcc_warn=yes
+        else
+          AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
+          _gcc_cflags_save=$CFLAGS
+          CFLAGS="-Wno-missing-field-initializers"
+          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
+                            [_gcc_warn=yes],[_gcc_warn=no])
+          AC_MSG_RESULT($_gcc_warn)
+          CFLAGS=$_gcc_cflags_save;
+        fi
+        if test x"$_gcc_warn" = xyes ; then
+          CFLAGS="$CFLAGS -W -Wno-missing-field-initializers"
+        fi
+
+        AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
+        _gcc_cflags_save=$CFLAGS
+        CFLAGS="-Wdeclaration-after-statement"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_warn=yes,_gcc_warn=no)
+        AC_MSG_RESULT($_gcc_warn)
+        CFLAGS=$_gcc_cflags_save;
+        if test x"$_gcc_warn" = xyes ; then
+          CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+        fi
+
+    else
+        # Not in maintainer mode: Use standard warnings.
+        CFLAGS="$CFLAGS -Wall"
+    fi
+
     CPPFLAGS="$CPPFLAGS -Wall"
 
-    AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
+    if test x"$_gcc_silent_wno" = xyes ; then
+      _gcc_warn=yes
+    else
+      AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
+      _gcc_cflags_save=$CFLAGS
+      CFLAGS="-Wno-pointer-sign"
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_warn=yes],[_gcc_warn=no])
+      AC_MSG_RESULT($_gcc_warn)
+      CFLAGS=$_gcc_cflags_save;
+    fi
+    if test x"$_gcc_warn" = xyes ; then
+       CFLAGS="$CFLAGS -Wno-pointer-sign"
+    fi
+
+    AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
     _gcc_cflags_save=$CFLAGS
-    CFLAGS="-Wno-pointer-sign"
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_psign=yes,_gcc_psign=no)
-    AC_MSG_RESULT($_gcc_psign)
+    CFLAGS="-Wpointer-arith"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_warn=yes,_gcc_warn=no)
+    AC_MSG_RESULT($_gcc_warn)
     CFLAGS=$_gcc_cflags_save;
-    if test x"$_gcc_psign" = xyes ; then
-       CFLAGS="$CFLAGS -Wno-pointer-sign"
+    if test x"$_gcc_warn" = xyes ; then
+       CFLAGS="$CFLAGS -Wpointer-arith"
     fi
 fi
 

commit 87e6811f2d1e72c501d14670ad911245a41c0828
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Mon Jun 1 22:52:23 2015 -0400

    use g_debug(format, ...) safely
    
    * pinentry/password-cache.c (password_cache_clear): use g_debug safely
      in case error->message is malformed.
    
    --
    
    Without this change, with -Werror=format-security, we see:
    
    password-cache.c: In function ‘password_cache_clear’:
    password-cache.c:153:7: error: format not a string literal and no format arguments [-Werror=format-security]
           g_debug(error->message);
           ^

diff --git a/pinentry/password-cache.c b/pinentry/password-cache.c
index 60a9c3a..70b33f4 100644
--- a/pinentry/password-cache.c
+++ b/pinentry/password-cache.c
@@ -150,7 +150,7 @@ password_cache_clear (const char *keygrip)
     {
       printf("Failed to clear password for key %s with secret service: %s\n",
 	     keygrip, error->message);
-      g_debug(error->message);
+      g_debug("%s", error->message);
       g_error_free (error);
       return -1;
     }

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

Summary of changes:
 assuan/assuan-handler.c     | 70 ++++++++++++++++++++++++++-------------------
 assuan/assuan-pipe-server.c |  5 +++-
 configure.ac                | 70 ++++++++++++++++++++++++++++++++++++++++-----
 gtk+-2/gtksecentry.c        | 36 +++++++++++++++++++++--
 gtk+-2/pinentry-gtk-2.c     | 23 +++++++++++++++
 pinentry/password-cache.c   |  2 +-
 pinentry/pinentry.c         | 62 +++++++++++++++++++++++++++++++--------
 qt4/secstring.cpp           | 10 +++----
 8 files changed, 220 insertions(+), 58 deletions(-)


hooks/post-receive
-- 
The standard pinentry collection
http://git.gnupg.org




More information about the Gnupg-commits mailing list