Thoughts on moving towards ANSI

Barry Margolin barmar at think.COM
Wed Feb 8 16:21:31 AEST 1989


In article <795 at n8emr.UUCP> lwv at n8emr.UUCP (Larry W. Virden) writes:
>  As an example, he mentioned
>that in APW C and I assume MPW C, a printf format of %p was used for 'pascal'
>format strings, where the length is specified as a 2 byte (?) value before
>the string.  Thus, he wasnt going to be able to support the ANSI %p for pointer
>format.

This can be handled simply by providing two implementations of printf,
which can be selected at link time.  Another possibility would be to
require something like Unix's "-Dformat=APW_format" for programs being
ported from the old version to the new version, where the APW_format
function implements the old printf semantics.  Or you could have a
compiler option that specifies whether you want compatible or ANSI
semantics (it could predefine a bunch of such macros).


Barry Margolin
Thinking Machines Corp.

barmar at think.com
{uunet,harvard}!think!barmar



More information about the Comp.std.c mailing list