🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #6157

Re: ANSI draft interpretation questions

#6157
From: Doug Gwyn
Date: Sun, 07 Jan 1990 04:22
47 lines
2246 bytes
In article <21675@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
-%*n	suppresses assignment; no action occurs: it is a no-op.

Right.

-	(%n is a conversion, but is not an assignment; ...

No, %n involves both a conversion and an assignment, but no input action.
The assignment is suppressed by *, in which case there is really no need
for the implementation to perform the conversion since it merely wastes
CPU cycles.  (The same applies to other conversion when the assignment is
suppressed, although most implementations will probably combine lexing
with conversion and thus not be conviently able to skip the conversion.)

-%[efg]	reads a floating point number.  If the input has one of the forms
-		<opt-sign><nondigit>
-		<opt-sign>.<nondigit>
-	no input is consumed.

Right.  Similarly for any other ill-formed string.

-			       If the input has one of the forms
-		<opt-sign><digit-seq><exp><opt-sign><nondigit>
-		<opt-sign><digit-seq>.<exp><opt-sign><nondigit>
-		<opt-sign><digit-seq>.<digit-seq><exp><opt-sign><nondigit>
-		<opt-sign>.<digit-seq><exp><opt-sign><nondigit>
-	the <exp>, the second <opt-sign>, and the <nondigit> remain
-	unconsumed.

Right.

-%[dioux] reads an integer.  If the input has one of the forms
-		<sign><nondigit>
-	no input is consumed.

Right.

-			       If the input has the form
-		<opt-sign>0x
-		<opt-sign>0X
-	and the conversion is either `i' or `x', the sign (if any) and
-	the zero are consumed; the `x' or `X' remains unconsumed.

Right (assuming that there is no hex digit immediately following the x).

DISCLAIMER:  This is my personal interpretation of the Standard;
for an official interpretation you must send a request to X3J11 via X3.
Technical Details
Message-ID: <11897@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!ccnysci!phri!cmcl2!adm!smoke!gwyn
References: <21623@mimsy.umd.edu> <11879@smoke.BRL.MIL> <21675@mimsy.umd.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!ccnysci!phri!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: ANSI draft interpretation questions
Message-ID: <11897@smoke.BRL.MIL>
Date: 7 Jan 90 04:22:56 GMT
References: <21623@mimsy.umd.edu> <11879@smoke.BRL.MIL> <21675@mimsy.umd.edu>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 47