printf() code size using Astart

ricmtodd at uok.UUCP.UUCP ricmtodd at uok.UUCP.UUCP
Wed Jul 16 07:13:00 AEST 1986


/* Written  2:26 pm  Jul  8, 1986 by mwm at eris.berkeley.edu in uok.UUCP:net.lang.c */
>>		if (foo == NULL) { ... }
>>	or:
>>		if (foo == 0) { ... }
>[...]
>>>Oh, well... I guess someone will make a good 'C' compiler someday...
>
>DEC has one for VMS. Convex has one for their box (though it may not
>be released yet). Anybody know of any others?
>	<mike
/* End of text from uok.UUCP:net.lang.c */
Well the Aztec C compiler on my PC does the above-mentioned test in one
instruction (a compare with zero). Note that this isn't the fancy version
with optimization or long pointers -- the code is probably worse for long
pointers.  In the test, foo was just a simple (small mem model) char pointer.
It also seems to generate reasonably good (i.e. not totally atrocious) code
for other constructs; remember this isn't even the OPTIMIZING compiler.
___________________________________________________________________________
Vila: "I am entitled to my own opinion."
Avon:  "Yes, but it's your constant assumption that everyone else is
        also that's so annoying."
___________________________________________________________________________
Richard Todd
USSnail:820 Annie Court,Norman OK 73069
UUCP: {allegra!cbosgd|ihnp4}!okstate!uokvax!uok!ricmtodd



More information about the Comp.lang.c mailing list