ANSI C & Fortran 8x - Expand cpp to partially support generalized precision
terry
terry at wsccs.UUCP
Sun Mar 20 20:50:40 AEST 1988
In article <4804 at sigi.Colorado.EDU>, swarbric at tramp.Colorado.EDU (Frank Swarbrick) writes:
> I don't know if you'd take this into concideration, but Turbo C already
> uses __int__() for a general interrupt.
> (i.e. #define geninterrupt(i) __int__(i) I have no idea why they have
> this, but they do.)
The response above was to an article suggesting __int__(999999) yeild the
smallest integer/char/long/etc. data type that could contain the value 999999,
and similar tricks, thus allowing you to declare only what you need to declare.
Not to be rude, but I don't think an interrupt routine on a severly localized
product based 1) on IBM DOS BIOS architecture, and 2) on 8086/80x86 calling
conventions based on register push order _should_ be considered.
The __int__(i) function is peculiar to Turbo C, which can not be demonstrated
to be K&R compatable as far as the book "The C Programming Language" has
defined pre-initialization of declared (non-external) global variables not
explicitly set to a value to have a value of 0. Turbo C does not do this.
Neither does it correctly treat local non-initialized static variables. It
is arguably not C. (I'll argue more, if you want :-}).
The function you talk about came as a result of the IBM-PC interrupt calling
sequence not being the same as the "normal" oprcedure calling sequence...
ie: PUSHing/POPing of registers on function entry/exit. It is NOT standard
to any other C, and while it lets you do nifty things on DOS, such as
memory resident pink-pad replacements, it doesn't do a thing for UNIX/VMS
systems, which already have a standard method of catching catchable interrupts
called 'signal()'. You can generate interrupts, too.
Nope, I think we can safley ignore Turbo C when considering standardization of
C across machines.
PS: Personally, I support the __<your_type_here>__(<sized object>) declarative
...it's pretty useless unless you are on a memory-limited machine, since you
might as well make it huge elsewhere if you can't remember what it should be.
| Terry Lambert UUCP: ...{ decvax, ihnp4 } |
| @ Century Software : ...utah-cs!uplherc!sp7040!obie!wsccs!terry |
| SLC, Utah |
| These opinions are not my companies, but if you find them |
| useful, send a $20.00 donation to Brisbane Australia... |
| 'There are monkey boys in the facility. Do not be alarmed; you are secure' |
More information about the Comp.lang.c
mailing list