1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Avoid strict aliasing warnings from gcc 4.8.

Copied from Perforce
 Change: 185484
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2014-04-12 21:44:18 +01:00
parent 7c107c76c0
commit bc72bc7f79
3 changed files with 11 additions and 11 deletions

View file

@ -422,7 +422,7 @@ void EventDump(mps_lib_FILE *stream)
for (kind = 0; kind < EventKindLIMIT; ++kind) {
for (event = (Event)EventLast[kind];
event < (Event)(EventBuffer[kind] + EventBufferSIZE);
(char *)event < EventBuffer[kind] + EventBufferSIZE;
event = (Event)((char *)event + event->any.size)) {
/* Try to keep going even if there's an error, because this is used as a
backtrace and we'll take what we can get. */

View file

@ -44,17 +44,17 @@ MRef Prmci3AddressHoldingReg(MutatorFaultContext mfc, unsigned int regnum)
config.h. */
/* TODO: The current arrangement of the fix operation (taking a Ref *)
forces us to pun these registers (actually `int` on LII3GC). We can
suppress the warning my casting through `char *` and this might make
suppress the warning by casting through `void *` and this might make
it safe, but does it really? RB 2012-09-10 */
switch (regnum) {
case 0: return (MRef)((char *)&mfc->threadState->__eax);
case 1: return (MRef)((char *)&mfc->threadState->__ecx);
case 2: return (MRef)((char *)&mfc->threadState->__edx);
case 3: return (MRef)((char *)&mfc->threadState->__ebx);
case 4: return (MRef)((char *)&mfc->threadState->__esp);
case 5: return (MRef)((char *)&mfc->threadState->__ebp);
case 6: return (MRef)((char *)&mfc->threadState->__esi);
case 7: return (MRef)((char *)&mfc->threadState->__edi);
case 0: return (void *)&mfc->threadState->__eax;
case 1: return (void *)&mfc->threadState->__ecx;
case 2: return (void *)&mfc->threadState->__edx;
case 3: return (void *)&mfc->threadState->__ebx;
case 4: return (void *)&mfc->threadState->__esp;
case 5: return (void *)&mfc->threadState->__ebp;
case 6: return (void *)&mfc->threadState->__esi;
case 7: return (void *)&mfc->threadState->__edi;
default:
NOTREACHED;
return NULL; /* Avoids compiler warning. */

View file

@ -243,7 +243,7 @@ static void protCatchOne(void)
different size" warnings in GCC, for the XCI3GC build. */
mfcStruct.address = (Addr)(Word)request.code[1];
AVER(sizeof(*mfcStruct.threadState) == sizeof(THREAD_STATE_S));
mfcStruct.threadState = (THREAD_STATE_S *)request.old_state;
mfcStruct.threadState = (void *)request.old_state;
if (ArenaAccess(mfcStruct.address,
AccessREAD | AccessWRITE,