Absolute size of 'short'
T. William Wells
bill at proxftl.UUCP
Wed Aug 31 00:25:41 AEST 1988
In article <1382 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
: In article <625 at proxftl.UUCP>, bill at proxftl.UUCP (T. William Wells) writes:
: > In article <11941 at steinmetz.ge.com> davidsen at crdos1.UUCP (bill davidsen)
: writes about 'int*6' as a portable declaration for a 6 byte integer.
:
: > That might be a good idea: allow an [unsigned] int*size (which
: > should be in bits since the standard defines things in terms of
: > bits) which, if the size is greater than 32 bits, is ...? The
:
: Make it 'int:size' to provide textual consitency with bit-feilds. Also,
: it shuld be signed. If you want an unsigned, make it 'unsigned int:size'.
I thought about using colon but decided against it. Tell me,
would:
int:16;
be a bit field declaration or a field declaration with no
members? Obviously the former, but the possibility of confusion
is not desirable. It might make the language non-LALR as well.
Also, my use of [unsigned] was intended as part of the syntax, to
imply that unsigned could be used for the declaration. Sorry for
the ambiguity.
: > The best way to get this is for some compiler writers to put it
: > into their compiler.
:
: I put something like it into Small-C once, but nobody but me ever saw it.
Better would be into something like the Gnu C compiler. Whatever
Stallman's political idiocies, the compiler does seem rather well
known. The Small-C compiler has the drawback that it isn't a
complete implementation of C, that makes it kinda invisible to
those of us who have to do real work in C. :-)
: I wanna say 'int:9 color' or 'int color:9' and only use up one byte
: on a Honeywell or Sperry.
Would be nice.
Here is an extension to this idea: use short*n to indicate that
you want it packed if this is reasonable, and int*n to indicate
that you don't care if it is packed.
---
Bill
novavax!proxftl!bill
More information about the Comp.lang.c
mailing list