Mail Archives: djgpp/2000/04/14/13:10:12
1st of all, thanks.
Hans-Bernhard Broeker wrote:
> Technically spoken, I think we're in the regime of 'undefined
> behaviour', here, i.e. with your example code, absolutely anything can
> happen, from 'it works as expected' all the way to a crash of the
> compiler, or even worse things.
Okay, I mean exactly what you talk here. But why "undefined"??? Compiler must
have difined behaviour or a list of *different valid* ways that get you to the
target.
I'm simply disappointed because of this behaviour. I've never had such problems
with other compilers (Borland Pascal/C, Warcom C). And I couldn't figure out
that I would have them.
> Inline assembly is definitely expert-level stuff. This implies that
> gcc has to assume the programmer knows what (s)he's doing, there. It
> cannot check this code itself, in all cases, so it's up to you to
> check it. Please don't take this as an offence, but I think this
> discussion has shown that you do not have all the necessary expertise
> yet, in that area.
Well, I might have insufficient experience with GCC, but I couldn't figure out
that inline assembly is too difficult with GCC. As I mentioned before, I've
never had such or similar problems with other compilers.
Simply don't get me wrong. GCC inline assembly seems the most unusual thing for
me. And running into the "undefined behaviour" problems is shocking.
Thanks.
Alexei A. Frounze
-----------------------------------------
Homepage: http://alexfru.chat.ru
Mirror: http://members.xoom.com/alexfru
- Raw text -