problems with schema parameter

Frank Heckenbach ih8mj at fjf.gnu.de
Sun May 31 00:11:39 CEST 2009


Martin Kalbfuß wrote:

> I wrote the following code:
> 
> 
> PROCEDURE play( map : map_type );
> VAR
> 
> 	player1 : player_type( 'O', 'a', 'd', 'w', 's', red, right, 10, 10,
> 3 );
> 	player2 : player_type( 'O', Crt.ksLeft, Crt.ksRight, Crt.ksUp,
> Crt.ksDown, green, left, 15, 15, 3 );
> 	table	:	table_type_ptr;
> 
> BEGIN
> 
> 	new( table, map.width, map.height );
> 
> 	...
> 
> 	END;
> 
> END;
> 
> 
> And here are the important types:
> 
> 
> 	x_coordinate_type = 1..table_width;
> 	x_dimension_type = 1..table_width;
> 
> 	map_type( w, h, p1x, p1y, p2x, p2y : INTEGER ) = RECORD
> 
> 		width       : x_dimension_type VALUE w;
> 		height      : y_dimension_type VALUE h;
> 		player1_pos : player_pos_type VALUE [ p1x; p1y ];
> 		player2_pos : player_pos_type VALUE [ p2x; p2y ];
> 		collision   : BOOLEAN VALUE FALSE;
> 		data        : ARRAY[ 1..h, 1..w ] OF CHAR;	
> 
> 	END;
> 
> 	table_type( w, h : INTEGER ) = ARRAY[ 1..h, 1..w ] OF field_type;
> 	table_type_ptr = ^table_type;
> 
> 
> When I want to compile the code I get the following error:
>
> snake.pas: In procedure `play':
> snake.pas:203: internal compiler error: in process_otherwise, at
> p/typecheck.c:4407
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://www.gnu-pascal.de/todo.html> for instructions.
> For Debian GNU/Linux specific bug reporting instructions,
> see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.

When reporting compiler problems, please always try to send a
complete program rather than fragments (i.e., from "program" to
"end." without any "..." -- it doesn't have to be your original
program, it can be fragments, but completed, so it should compile,
if it weren't for the compiler error -- and then, of course, check
that the compiler error actually occurs with the program you send).
This makes it easier for everyone to check the problem and possible
fixes, and you can make sure you don't forget some declarations
(such as player_pos_type etc.).

Also please specify the compiler version (do "gpc -v") and operating
system (which seems to be Debian GNU/Linux according to the error
message).

Frank

-- 
Frank Heckenbach, f.heckenbach at fh-soft.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
http://www.gnu-pascal.de/todo.html
GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE  D101 CD02 4C9D 0FE0 E5E8





More information about the Gpc mailing list