Skip to contentSkip to conversation

C undefined behavior fix

PATCH [email protected] 2 participants 2 messages Jan 6, 2002

lore
Share & tools
lore
#0 lore raw

<<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 ?

Quoted 1 line
Quoted 1 line

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.

#1 lore raw

[email protected] writes:

[...]

| 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.

Isn't the incriminated construct already outside of C and non-portable?

-- Gaby
CodeSourcery, LLC http://www.codesourcery.com