Re: [PATCH] mig: silence compiler warnings in generated server code
I couldn't find the offending line in upstream, so I sent it to
debian-hurd on purpose. Maybe this is already fixed in upstream?
On 7/24/06, Thomas Schwinge <email@example.com> wrote:
On Sun, Jul 23, 2006 at 09:33:11PM -0400, Ben Asselstine wrote:
> This patch silences the `warning: dereferencing type-punned pointer
> will break strict-aliasing rules' warnings that gcc gives while
> compiling mig-generated server code.
> This patch was tested with a rebuilt libtrivfs and a hello translator.
... but it wasn't attached to the email. ;-)
I also added bug-hurd to the cc list.
--- mig-1.3.1.orig/server.c 1999-10-11 08:44:49.000000000 +0000
+++ mig-1.3.1/server.c 2006-07-23 20:06:32.000000000 +0000
@@ -418,7 +418,7 @@ WriteTypeCheck(FILE *file, register cons
if (akCheck(arg->argKind, akbRequestQC))
- fprintf(file, "\tif (* (int *) &In%dP->%s != * (int *) &%sCheck)\n",
+ fprintf(file, "\tif (memcmp (&In%dP->%s, &%sCheck, sizeof (int)))\n",
arg->argRequestPos, arg->argTTName, arg->argVarName);