[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] New dimensions in ABI design braindamage
From: |
felix . winkelmann |
Subject: |
[Chicken-hackers] New dimensions in ABI design braindamage |
Date: |
Thu, 09 Jul 2015 20:17:08 +0200 |
> address@hidden scripsit:
>
> > a function ptr of type
> >
> > typedef void (*C_proc4)(C_word, C_word, C_word, C_word, C_word)
> >
> > that points to a function of (say) this type
> >
> > void myproc(C_word c, C_word k, C_word a1, ...)
> >
> > will break,
>
> Yes. That's undefined behavior according to the C standard, and if it happens
> to work when compiled with gcc on i386 and x86_64, that's just good luck.
Is it? CHICKEN uses this approach since its beginning and has been ported to
more platforms than many other Language implementations.
No - C represents a machine model, that we have (more or less knowingly) sucked
in with K&R, the CRM or by looking at other peoples code. So far everybody has
been careful to adhere to this machine model, for several decades. If all
undefined behaviour in C would cause a crash, then tomorrow you wouldn't been
able to read this mail, nor browse the internet, or do anything at all.
In other words, I don't care about any formal definition of C (which nobody
reads, anyway.) It's only now, where H/W-designers have run out of ideas, and
every attempt is taken to squeeze out a bit more performance through S/W,
recklessly taking advantage of holes in the language Specs - and for this goal
vendors that don't care much about everything but their own development-tools
and -processes like to take shortcuts. This change in iOS ABI is just dumb, a
stupid idea, a quick hack, done without much thought of everything but Xcode,
ObjC and a bunch of C libraries that are considered OK on iOS.
felix