diff --git a/ChangeLog b/ChangeLog index 71f72afbf..ddfbd309d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-10-17 Werner Koch + + * configure.ac: Use more warning options with modern GCCs. + 2008-09-29 Werner Koch * configure.ac: Require libgcrypt 1.4. diff --git a/agent/ChangeLog b/agent/ChangeLog index f45c6d7f3..f3f5131d3 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,8 @@ +2008-10-17 Werner Koch + + * call-scd.c (start_scd) [W32]: Use snprintf again because we now + always use the estream variant. + 2008-10-15 Werner Koch * call-scd.c (start_scd): Enable assuan loggging if requested. diff --git a/agent/call-scd.c b/agent/call-scd.c index 65483e55d..fce132004 100644 --- a/agent/call-scd.c +++ b/agent/call-scd.c @@ -381,10 +381,8 @@ start_scd (ctrl_t ctrl) char buf[100]; #ifdef HAVE_W32_SYSTEM - /* Use estream snprintf due to a bug in mingw32 related to the l - modifier. */ - estream_snprintf (buf, sizeof buf, "OPTION event-signal=%lx", - (unsigned long)get_agent_scd_notify_event ()); + snprintf (buf, sizeof buf, "OPTION event-signal=%lx", + (unsigned long)get_agent_scd_notify_event ()); #else snprintf (buf, sizeof buf, "OPTION event-signal=%d", SIGUSR2); #endif diff --git a/agent/command.c b/agent/command.c index f6bfaa64a..066494101 100644 --- a/agent/command.c +++ b/agent/command.c @@ -80,7 +80,7 @@ static struct putval_item_s *putval_list; -/* To help polling clients, we keep tarck of the number of certain +/* To help polling clients, we keep track of the number of certain events. This structure keeps those counters. The counters are integers and there should be no problem if they are overflowing as callers need to check only whether a counter changed. The actual diff --git a/common/ChangeLog b/common/ChangeLog index e517872d2..b71d9b72b 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,7 @@ +2008-10-17 Werner Koch + + * util.h (snprintf) [W32]: Redefine to estream_snprintf. + 2008-09-03 Werner Koch * convert.c (hex2str): New. diff --git a/common/miscellaneous.c b/common/miscellaneous.c index b7210ef2b..1c88068f1 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -31,6 +31,8 @@ static void my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr) { + (void)dummy; + /* Map the log levels. */ switch (level) { @@ -51,6 +53,8 @@ my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr) static void my_gcry_fatalerror_handler (void *opaque, int rc, const char *text) { + (void)opaque; + log_fatal ("libgcrypt problem: %s\n", text ? text : gpg_strerror (rc)); abort (); } @@ -64,6 +68,8 @@ my_gcry_outofcore_handler (void *opaque, size_t req_n, unsigned int flags) { static int been_here; /* Used to protect against recursive calls. */ + (void)opaque; + if (!been_here) { been_here = 1; @@ -140,6 +146,8 @@ print_hexstring (FILE *fp, const void *buffer, size_t length, int reserved) #define tohex(n) ((n) < 10 ? ((n) + '0') : (((n) - 10) + 'A')) const unsigned char *s; + (void)reserved; + for (s = buffer; length; s++, length--) { putc ( tohex ((*s>>4)&15), fp); diff --git a/common/util.h b/common/util.h index 572fa1a6a..b21e9283d 100644 --- a/common/util.h +++ b/common/util.h @@ -46,6 +46,12 @@ #define asprintf estream_asprintf #define vasprintf estream_vasprintf +/* Due to a bug in mingw32's snprintf related to the 'l' modifier we + better use our snprintf. */ +#ifdef HAVE_W32_SYSTEM +#define snprintf estream_snprintf +#endif + /* GCC attributes. */ #if __GNUC__ >= 4 @@ -260,6 +266,7 @@ int match_multistr (const char *multistr,const char *match); static inline char * ttyname (int fd) { + (void)fd; return NULL; } #endif /* !HAVE_TTYNAME */ diff --git a/configure.ac b/configure.ac index 010115ae2..ec5361c55 100644 --- a/configure.ac +++ b/configure.ac @@ -1248,6 +1248,24 @@ if test "$GCC" = yes; then if test "$USE_MAINTAINER_MODE" = "yes"; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security" + 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_wopt=yes,_gcc_wopt=no) + AC_MSG_RESULT($_gcc_wopt) + CFLAGS=$_gcc_cflags_save; + if test x"$_gcc_wopt" = xyes ; then + CFLAGS="$CFLAGS -W -Wno-sign-compare -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_wopt=yes,_gcc_wopt=no) + AC_MSG_RESULT($_gcc_wopt) + CFLAGS=$_gcc_cflags_save; + if test x"$_gcc_wopt" = xyes ; then + CFLAGS="$CFLAGS -Wdeclaration-after-statement" + fi else CFLAGS="$CFLAGS -Wall" fi diff --git a/g10/ChangeLog b/g10/ChangeLog index 4b25d8316..a65425cce 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,9 +1,16 @@ +2008-10-17 Werner Koch + + * main.h (idea_cipher_warn): Use do while construct in place of an + empty definition. + 2008-10-03 David Shaw - * main.h, mainproc.c (check_sig_and_print), - keylist.c (list_keyblock_print), pkclist.c (do_edit_ownertrust), - keyedit.c (menu_showphoto), photoid.c (generate_photo_id, - show_photos), misc.c (pct_expando): Add %v and %V expandos so + * main.h, mainproc.c (check_sig_and_print) + * keylist.c (list_keyblock_print) + * pkclist.c (do_edit_ownertrust) + * keyedit.c (menu_showphoto) + * photoid.c (generate_photo_id, show_photos) + * misc.c (pct_expando): Add %v and %V expandos so that displaying photo IDs can show the attribute validity tag (%v) and string (%V). Originally by Daniel Gillmor. diff --git a/g10/main.h b/g10/main.h index d6b5a967e..be60d17ce 100644 --- a/g10/main.h +++ b/g10/main.h @@ -93,7 +93,7 @@ int openpgp_md_test_algo( int algo ); #ifdef USE_IDEA void idea_cipher_warn( int show ); #else -#define idea_cipher_warn(a) +#define idea_cipher_warn(a) do { } while (0) #endif struct expando_args diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c index b7e76a874..5a8c0c01f 100644 --- a/g10/pubkey-enc.c +++ b/g10/pubkey-enc.c @@ -246,7 +246,7 @@ get_it( PKT_pubkey_enc *enc, DEK *dek, PKT_secret_key *sk, u32 *keyid ) log_info(_("cipher algorithm %d%s is unknown or disabled\n"), dek->algo, dek->algo == CIPHER_ALGO_IDEA? " (IDEA)":""); if(dek->algo==CIPHER_ALGO_IDEA) - idea_cipher_warn(0); + idea_cipher_warn (0); } dek->algo = 0; goto leave; diff --git a/jnlib/dynload.h b/jnlib/dynload.h index a58bc19f9..54774650d 100644 --- a/jnlib/dynload.h +++ b/jnlib/dynload.h @@ -31,6 +31,7 @@ static inline void * dlopen (const char * name, int flag) { void * hd = LoadLibrary (name); + (void)flag; return hd; } diff --git a/scd/ChangeLog b/scd/ChangeLog index b0550cd26..05dcb105d 100644 --- a/scd/ChangeLog +++ b/scd/ChangeLog @@ -1,3 +1,8 @@ +2008-10-16 Werner Koch + + * command.c (cmd_disconnect): New dummy command. + (register_commands): Register command. + 2008-10-15 Werner Koch * command.c (scd_command_handler): Return true if there is no more diff --git a/scd/command.c b/scd/command.c index 7d2515474..4c55e6167 100644 --- a/scd/command.c +++ b/scd/command.c @@ -1638,6 +1638,19 @@ cmd_restart (assuan_context_t ctx, char *line) } +/* DISCONNECT + + TBD + +*/ +static int +cmd_disconnect (assuan_context_t ctx, char *line) +{ + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); +} + + + /* APDU [--atr] [--more] [hexstring] Send an APDU to the current reader. This command bypasses the high @@ -1756,6 +1769,7 @@ register_commands (assuan_context_t ctx) { "UNLOCK", cmd_unlock }, { "GETINFO", cmd_getinfo }, { "RESTART", cmd_restart }, + { "DISCONNECT", cmd_disconnect }, { "APDU", cmd_apdu }, { NULL } };