[net.lang.c] A question about scanf

brahms@spp2.UUCP (10/30/84)

[}{]

The 4.1 and 4.2 version of c has several different conversion characters
that are not list and K&R.  The one that I am interested in is the '['
conversion character.  The '[' character defines either the break set, or
the set of legal characters for the string.

Question:	Is this strictly a Berklyism?  What is its history?

Thanx.

			-- Brad brahms
			   usenet: {decvax,ucbvax}!trwrb!trwspp!brahms
			   arpa:   Brahms@usc-eclc

henry@utzoo.UUCP (Henry Spencer) (11/02/84)

> The 4.1 and 4.2 version of c has several different conversion characters
> that are not list and K&R.  The one that I am interested in is the '['
> conversion character....

K&R is a tutorial, not a reference manual.  %[ has been in scanf since
scanf was first released to the world.  At first glance (I haven't done
a word-by-word comparison), the 4.1 scanf manual page looks identical
to the V7 one.  Amazingly, it looks like Berkeley hasn't messed with
("improved") scanf.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry

steiny@scc.UUCP (Don Steiny) (11/06/84)

***

	Good advice about scanf is not to use it.   On Wollongong
V7 it exhibits bizarre behavior, and it does not work at all on
several ports I have used.  Now there are more differences! Bah!

-- 
scc!steiny
Don Steiny - Personetics @ (408) 425-0382
109 Torrey Pine Terr.
Santa Cruz, Calif. 95060
ihnp4!pesnta  -\
fortune!idsvax -> scc!steiny
ucbvax!twg    -/

frank@pokey.UUCP (11/12/84)

> ***
> 
> 	Good advice about scanf is not to use it.   On Wollongong
> V7 it exhibits bizarre behavior, and it does not work at all on
> several ports I have used.  Now there are more differences! Bah!
> 
> -- 
> scc!steiny
> Don Steiny - Personetics @ (408) 425-0382
> 109 Torrey Pine Terr.
> Santa Cruz, Calif. 95060
> ihnp4!pesnta  -\
> fortune!idsvax -> scc!steiny
> ucbvax!twg    -/

Hear hear!  A favorite trick of library writers seems to be interpreting
the return variable as representing the number of items recognized, 
including each literal character scanned (as opposed to just the desired
variables).  This leads to outrageous return counts.

Others can't seem to get straight the syntax for recognizing shorts.
Are they h, or hd, or h with modifiers?  Who knows?  So much for 
portability.