This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: dewar at gnat dot com
- To: fw at deneb dot enyo dot de, paulus at samba dot org
- Cc: gcc at gcc dot gnu dot org, linux-kernel at vger dot kernel dot org,linuxppc-dev at lists dot linuxppc dot org, trini at kernel dot crashing dot org,velco at fadata dot bg
- Date: Fri, 4 Jan 2002 17:43:25 -0500 (EST)
- Subject: Re: [PATCH] C undefined behavior fix
<<Sorry, you are correct. I should have written "One of the reasons why
C used to be a good language for writing operating system kernels ..."
>>
C is perfectly well suited for writing operating system kernels, but you
absolutely HAVE to know what you are doing, and that includes knowing the
C standard accurately, and clearly identifying any implementation dependent
behavior that you are counting on.
The "used to be" is bogus. The (base + offset) memory model of C has been
there since the earliest days of the definition of C. The only thing that
"used to be" the case is that people ignored these rules freely and since
compilers were fairly stupid, they got away with this rash behavior.