www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/02/15:20:14

Date: Tue, 2 Feb 1999 13:24:38 -0500
Message-Id: <199902021824.NAA00657@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <3.0.6.32.19990202120936.00906210@pop.netaddress.com> (message
from Paul Derbyshire on Tue, 02 Feb 1999 12:09:36 -0500)
Subject: Re: Alignment fault signals
References: <3 DOT 0 DOT 6 DOT 32 DOT 19990202120936 DOT 00906210 AT pop DOT netaddress DOT com>
Reply-To: djgpp AT delorie DOT com

> On architectures where the CPU enforces strict alignment of code and
> data, is there a fatal signal raised specific to those systems when
> an alignment fault occurs?

Yes.  SIGBUS is common, but it's not defined by POSIX because it's
implementation dependent.

The easiest way to know for sure is with a test program:

main()
{
  int foo[3];
  *(int *)(((char *)foo)+1) = 0;
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019