Article View: comp.std.c
Article #3874Re: Why "long long" doesn't work.
From: halasz
Date: Sun, 27 Aug 1995 03:05
Date: Sun, 27 Aug 1995 03:05
23 lines
1748 bytes
1748 bytes
In article <41g85d$kc@newsbf02.news.aol.com>, ffarance@aol.com (FFarance) writes : ... : How would this lookup work? Since the format string is interpreted : by "printf", "printf" would have to know how big the next argument : is on the stack -- how would it know how big the next argument is? : If we knew the size of each argument, we wouldn't need the "va_arg" : (variable argument) feature. Even if we knew how big the stack : argument is, this doesn't tell us anything about the precision used : in that container. Some implementations might store an "exact:1" as : the high bit, others the low bit -- both have the same container size. : It would be hard to distinquish between "exact:1" and "exact:2" knowing : only the size, yet you'd need to know this information to print the : value properly. : : Your solution, although readable, would be very difficult to implement. It by nou is probablie too late, but this is the big problem with uzing string for format. If a format were a type of its own, and parsd (as in Algol 68), the compiler coud match format element and valu or variable, and it certainlie would be known what converzions a program seeks. This would make "printf" much nimbler, for one coud be sure that onlie the needed is linkd into the runfile (when that indeed is the case, not shared librarie), and the types would be matchd.
Technical Details
Message-ID:
<41ondq$kn9@caip.rutgers.edu>Path:
arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mailReferences:
<41fdv8$ici@milo.mcs.anl.gov> <41g85d$kc@newsbf02.news.aol.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail From: halasz@caip.rutgers.edu Newsgroups: comp.std.c Subject: Re: Why "long long" doesn't work. Date: 26 Aug 1995 23:05:30 -0400 Organization: Rutgers University Message-ID: <41ondq$kn9@caip.rutgers.edu> References: <41fdv8$ici@milo.mcs.anl.gov> <41g85d$kc@newsbf02.news.aol.com> NNTP-Posting-Host: caip.rutgers.edu