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: paulus at samba dot org, velco at fadata dot bg
- Cc: dewar at gnat dot com, gcc at gcc dot gnu dot org, linux-kernel at vger dot kernel dot org,trini at kernel dot crashing dot org
- Date: Sun, 6 Jan 2002 08:16:35 -0500 (EST)
- Subject: Re: [PATCH] C undefined behavior fix
<<Number of people suggested using assembly for this, why you keep
ignoring it and insist instead on changing the compiler, changing the
C standard, switching to another compiler and similar unproductive
ideas put forward solely for the sake of argument ?
>>
Maybe people will jump on me for saying this, but one objection I have to
using assembly is that the assembly language feature on gcc seems
a) awfully complicated, requiring more detailed knowledge of how the compiler
works than most programmers have.
b) certainly more complicated than comparable features in other compilers,
e.g. Borland C.
c) not that well documented
We find in the Ada world (where we have duplicated the C assembly language
feature more or less 100% exactly), that our customers almost always have to
ask us for help in getting asm inserts correct.
The GNU-C feature here is very powerful, but really not very easy to use!
I also find that introducing asm for this purpose is unnecessarily non-portable.
Yes in some cases, we are talking about very target specific code, but in other
cases the code is not so target specific, and it is desirable to stay within
C if possible.