[comp.sys.mac.programmer] MPW C 3.0 bug again

d83_sven_a@tekno.chalmers.se (Sven (Sciz) Axelsson) (02/03/89)

OK, now I have tracked down the bug I wrote about yesterday. It was not at all
what I thought it was - some sort of compiler limitation - but a real bug in
the lexical analyzer of MPW C 3.0 beta 1. Try this:

	bomb()
	{
		int dum;
		
		dum = undeclared[1];	/* here it is! */
	}
	
The compiler bombs with ID=2 (today) or ID=5 (yesterday) as soon as an
undeclared array is referenced. Is this a known bug? Anyway, you all know
of it now - beware!

+-------------------------+--------------------------------+------------------+
|   Sven Axelsson         |  d83_sven_a@tekno.chalmers.se  |  DISCLAIMER:     |
|   dep:t of Linguistics  |          (^^ best ^^)          |                  |
|   univ. of Gothenburg   |        dlv_sa@hum.gu.se        |  This is not     |
|   SWEDEN                |      usdsa@seguc21.bitnet      |  a disclaimer.   |
+-------------------------+--------------------------------+------------------+

keith@Apple.COM (Keith Rollin) (02/05/89)

In article <527@tekno.chalmers.se> d83_sven_a@tekno.chalmers.se (Sven (Sciz) Axelsson) writes:
>OK, now I have tracked down the bug I wrote about yesterday. It was not at all
>what I thought it was - some sort of compiler limitation - but a real bug in
>the lexical analyzer of MPW C 3.0 beta 1. Try this:
>
>	bomb()
>	{
>		int dum;
>		
>		dum = undeclared[1];	/* here it is! */
>	}
>	
>The compiler bombs with ID=2 (today) or ID=5 (yesterday) as soon as an
>undeclared array is referenced. Is this a known bug? Anyway, you all know
>of it now - beware!
>

If you are going to use pre-final software, you should expect some bugs to
pop up. Here is what happened when I tried your fragment with the final version
of MPW C 3.0:


c test.c
#
#                dum = undeclared[1];    /* here it is! */
#                               ?                          
### Error 23 identifier not declared
#                                  ?                       
### Error 211 Pointer type required
#                                  ?                       
### Error 30 ';' expected
#                                  ?                       
### Error 22 error in factor
#-------------------------------------------------------------------------------
-------------------------------------------------
    File "test.c"; Line 5
#-------------------------------------------------------------------------------
-------------------------------------------------

If, when you get the final version of MPW 3.0, you still have this problem,
be sure to let us know! 


Keith Rollin  ---  Apple Computer, Inc.  ---  Developer Technical Support
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"Argue for your limitations, and sure enough...they're yours" -Bach, Illusions