Article View: comp.std.c
Article #3847Re: Why "long long" doesn't work.
From: Peter Holzer
Date: Thu, 24 Aug 1995 15:41
Date: Thu, 24 Aug 1995 15:41
32 lines
1680 bytes
1680 bytes
geisler@mcs.anl.gov (Jonathan Geisler) writes:
>FFarance (ffarance@aol.com) wrote:
>: printf("%?d",precof(x),x);
>: printf("%*?d",field_width,precof(x),x);
>: The "precof()" operator returns a "prec_t" which extracts the precision
>: information (and other SBEIR information) from the operand. The "scanf"
>: function is extended similarly.
>It seems like a little overkill to have to always include a ?/precof()
>combination for any precision number. Why not define a new modifier
>that will automatically do the same lookup as precof() without the need
>for the programmer to explicitly state it? So, for example, the 2 above
>examples become (assuming the new modifier is 'P'):
> printf("%P", x); AND
> printf("%*P", field_width, x);
>This looks much more reasonable and readable to me.
It looks a lot harder to implement to me. One of the nice things about C was
that you could implement the C library independently from the C compiler.
The C compiler didn't have to know about printf and printf could be written
entirely in portable C. This is not possible with your proposal (unless you
promote everything to (int atleast:128), which I wouldn't want the compiler
to do.
hp
Technical Details
Message-ID:
<hjp.809278914@wsrtest>Path:
arc1-ca.pugleaf.net!wsrcom.wsr.ac.at!hjpReferences:
<808962429snz@genesis.demon.co.uk> <41crmm$o3u@newsbf02.news.aol.com> <41fdv8$ici@milo.mcs.anl.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wsrcom.wsr.ac.at!hjp From: hjp@wsr.ac.at (Peter Holzer) Newsgroups: comp.std.c Subject: Re: Why "long long" doesn't work. Date: 24 Aug 95 15:41:54 GMT Organization: WSR, Vienna, Austria Message-ID: <hjp.809278914@wsrtest> References: <808962429snz@genesis.demon.co.uk> <41crmm$o3u@newsbf02.news.aol.com> <41fdv8$ici@milo.mcs.anl.gov> NNTP-Posting-Host: wsrtest.wsr.ac.at X-Newsreader: NN version 6.5.0 #4 (NOV)