diff options
author | Yang Tse <yangsita@gmail.com> | 2008-10-07 18:28:24 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-10-07 18:28:24 +0000 |
commit | 27db0450952b356c7aa98296f5b03317d8c15a70 (patch) | |
tree | 54f94992487caae3b900f585ed1b043d8a82a466 | |
parent | db8c75f08d8b643846ffea0ec77669b0ac2c325a (diff) |
fix compiler warning: dereferencing type-punned pointer will break strict-aliasing rules
-rw-r--r-- | lib/getinfo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c index 6f8ebb87e..c8841637e 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -78,6 +78,11 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...) struct curl_slist **param_slistp=NULL; int type; + union { + struct curl_certinfo * to_certinfo; + struct curl_slist * to_slist; + } ptr; + if(!data) return CURLE_BAD_FUNCTION_ARGUMENT; @@ -220,7 +225,8 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...) case CURLINFO_CERTINFO: /* Return the a pointer to the certinfo struct. Not really an slist pointer but we can pretend it is here */ - *param_slistp = (struct curl_slist *)&data->info.certs; + ptr.to_certinfo = &data->info.certs; + *param_slistp = ptr.to_slist; break; default: return CURLE_BAD_FUNCTION_ARGUMENT; |