mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
common/
2010-04-20 Marcus Brinkmann <marcus@g10code.de> * logging.c (do_log_ignore_arg): New helper function. (log_string): Use it to remove ugly volatile hack that causes gcc warning. (log_flush): Likewise. * sysutils.c (gnupg_unsetenv) [!HAVE_W32CE_SYSTEM]: Return something. (gnupg_setenv) [!HAVE_W32CE_SYSTEM]: Likewise. * pka.c (get_pka_info): Solve strict aliasing rule violation. * t-exechelp.c (test_close_all_fds): Use dummy variables to silence gcc warning. kbx/ 2010-04-20 Marcus Brinkmann <marcus@g10code.de> * keybox-update.c [!HAVE_DOSISH_SYSTEM]: Include ../common/sysutils.h even then to silence gcc warning about missing declaration of gnupg_remove. tools/ 2010-04-20 Marcus Brinkmann <marcus@g10code.de> * gpgconf-comp.c (option_check_validity): Use dummy variables to silence gcc warning.
This commit is contained in:
parent
6616ba9a1e
commit
0e960d940a
10 changed files with 77 additions and 35 deletions
|
@ -515,16 +515,23 @@ log_logv (int level, const char *fmt, va_list arg_ptr)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
do_log_ignore_arg (int level, const char *str, ...)
|
||||
{
|
||||
va_list arg_ptr;
|
||||
va_start (arg_ptr, str);
|
||||
do_logv (level, 1, str, arg_ptr);
|
||||
va_end (arg_ptr);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
log_string (int level, const char *string)
|
||||
{
|
||||
/* We need to provide a dummy arg_ptr. volatile is needed to
|
||||
suppress compiler warnings. The static is required for gcc 4.4
|
||||
because it seems that it detects that a volatile automatic
|
||||
variable is not any good if not initialized. */
|
||||
static volatile va_list dummy_arg_ptr;
|
||||
|
||||
do_logv (level, 1, string, dummy_arg_ptr);
|
||||
/* We need a dummy arg_ptr, but there is no portable way to create
|
||||
one. So we call the do_logv function through a variadic wrapper.
|
||||
MB: Why not just use "%s"? */
|
||||
do_log_ignore_arg (level, string);
|
||||
}
|
||||
|
||||
|
||||
|
@ -604,8 +611,7 @@ log_printf (const char *fmt, ...)
|
|||
void
|
||||
log_flush (void)
|
||||
{
|
||||
static volatile va_list dummy_arg_ptr;
|
||||
do_logv (JNLIB_LOG_CONT, 1, NULL, dummy_arg_ptr);
|
||||
do_log_ignore_arg (JNLIB_LOG_CONT, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue