[comp.sys.mac.programmer] possible THINK C 3.0 bug

swilson%thetone@Sun.COM (Scott Wilson) (10/14/88)

Having cried bug at least once too often in my life, I'll put
this in the form of a question.

According to K&R 1st ed. page 198 it says:

	When an initializer applies to a scalar (a pointer or object
	of arithmetic type), it consists of a single expression,
	perhaps in braces.

and K&R 2nd ed. page 219 says:

	The initializer for a pointer or an object of arithmetic type
	is a single expression, perhaps in braces.

yet the following short program produces an error message and will
not compile under THINK C 3.0:

	int x = { 1 };

	main()
	{
	        printf("x = %d\n", x);
	}


The offending line is the first and the error message is "too many
initializers."  Is there any reason why this isn't a bug?


--
Scott Wilson		arpa: swilson@sun.com
Sun Microsystems	uucp: ...!sun!swilson
Mt. View, CA

singer@endor.harvard.edu (Rich Siegel) (10/19/88)

In article <72894@sun.uucp> swilson@sun.UUCP () writes:
>
>	int x = { 1 };
>
	LightspeedC takes the braces to imply an aggregate type. Thisturn
of syntax will be supported in the ANSI-compatible release of LightspeedC.

		--Rich




Rich Siegel
Staff Software Developer
THINK Technologies Division, Symantec Corp.
Internet: singer@endor.harvard.edu
UUCP: ..harvard!endor!singer
Phone: (617) 275-4800 x305

Any opinions stated in this article do not necessarily reflect the views
or policies of Symantec Corporation or its employees.