ANSI draft interpretation questions

Chris Torek chris at mimsy.umd.edu
Sun Jan 7 11:18:18 AEST 1990


In article <11879 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
>The paragraph around line 40 on page 136 of the December draft makes it
>clear that the result of the conversion for the n specifier is subject
>to assignment suppression by *.  (Yes, there IS a conversion, just no
>input operation.)

Well, I would argue that it makes it the most reasonable interpretation,
but definitely *not* `clear'.

Anyway, here are the (apparent) answers:

%*n	suppresses assignment; no action occurs: it is a no-op.
	(%n is a conversion, but is not an assignment; yet it can
	be suppressed with assignment suppression.)

%[efg]	reads a floating point number.  If the input has one of the forms

		<opt-sign><nondigit>
		<opt-sign>.<nondigit>

	no input is consumed.  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.

	The definitions of <opt-sign>, <digit-seq>, <exp>, and <nondigit>
	are the obvious.  (Note that EOF counts as a nondigit.)

%[dioux] reads an integer.  If the input has one of the forms

		<sign><nondigit>

	no input is consumed.  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.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.std.c mailing list