[PATCH][TRIVIAL] - libgcrypt-1.2.3 - strict-aliasing rules fixup

Alon Bar-Lev alon.barlev at gmail.com
Wed Jan 10 21:30:27 CET 2007


Hello,

The following solves gcc strict-aliasing rules warning.

Best Regards,
Alon Bar-Lev.

diff -urNp libgcrypt-1.2.3.org/cipher/ac.c libgcrypt-1.2.3/cipher/ac.c
--- libgcrypt-1.2.3.org/cipher/ac.c	2005-07-29 16:45:48.000000000 +0300
+++ libgcrypt-1.2.3/cipher/ac.c	2007-01-10 22:13:05.000000000 +0200
@@ -137,9 +137,11 @@ gcry_ac_data_copy_internal (gcry_ac_data
     data_new->data_n = data->data_n;
 
   if (! err)
-    /* Allocate space for named MPIs.  */
-    err = _gcry_malloc (sizeof (gcry_ac_mpi_t) * data->data_n, 0,
-			(void **) &data_new->data);
+    {
+      /* Allocate space for named MPIs.  */
+      err = _gcry_malloc (sizeof (gcry_ac_mpi_t) * data->data_n, 0, &p);
+      data_new->data = (gcry_ac_mpi_t *)p;
+    }
 
   if (! err)
     {




More information about the Gnupg-devel mailing list