From 02102b8b1899e7a60565e6f2f0f7373b408ce99f Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Fri, 4 Sep 2009 11:13:03 +0200 Subject: [PATCH] Fixed a type-punned warning in compilation --- src/modest-tny-account-store.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 7c1e430..f216937 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -537,6 +537,7 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc const gchar *server_account_name; gchar *url_string; PwdAttempt *attempt = NULL; + gpointer attempt_ptr = NULL; g_return_val_if_fail (account, NULL); @@ -578,12 +579,15 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc return NULL; } + /* We need to do this to avoid "dereferencing type-punned pointer will break strict-aliasing rules" */ + attempt_ptr = (gpointer) &attempt; + /* This hash map stores passwords, including passwords that are not stored in gconf. */ /* Is it in the hash? if it's already there, it must be wrong... */ already_asked = priv->password_hash && g_hash_table_lookup_extended (priv->password_hash, server_account_name, NULL, - (gpointer*)&attempt); + &attempt_ptr); /* If the password is not already there, try ModestConf */ if (!already_asked) { -- 1.7.9.5