aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-10-17 19:18:46 +0000
committerWerner Koch <[email protected]>2008-10-17 19:18:46 +0000
commit0698c5169fca5b7969e6b0fa4de22b693e7fd2e4 (patch)
treeebfa56dde985a7925e9dc6ea60bda96569106718 /common
parentReset the context lock flag after a failed dirmngr start which may happend (diff)
downloadgnupg-0698c5169fca5b7969e6b0fa4de22b693e7fd2e4.tar.gz
gnupg-0698c5169fca5b7969e6b0fa4de22b693e7fd2e4.zip
Use more warning options with modern GCCs.
Other minor changes.
Diffstat (limited to 'common')
-rw-r--r--common/ChangeLog4
-rw-r--r--common/miscellaneous.c8
-rw-r--r--common/util.h7
3 files changed, 19 insertions, 0 deletions
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 <[email protected]>
+
+ * util.h (snprintf) [W32]: Redefine to estream_snprintf.
+
2008-09-03 Werner Koch <[email protected]>
* 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 */