This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: dewar at gnat dot com
- To: dewar at gnat dot com, guerby at acm dot org
- Cc: gcc at gcc dot gnu dot org, linux-kernel at vger dot kernel dot org, paulus at samba dot org,trini at kernel dot crashing dot org, velco at fadata dot bg
- Date: Sun, 6 Jan 2002 08:43:53 -0500 (EST)
- Subject: Re: [PATCH] C undefined behavior fix
<<I see no distinction between read and write in the text of the Ada standard.
The point is that the implementation of a write has, given your quote from the
RM, pretty much no choice but to do an exactly "correct" write, but for a
read, there is nothing to stop reading MORE than the minimum, the requirement
of atomicity is still met. Now of course in your array example, you are
exactly right, so you could rig up an array with elements surrounding the
one you really want. A bit heavy, but yes, that's a trick that will work.