Hello all,
I am trying to port a large program written on a SUN to linux using gpc. So far
it goes well, but I run into an error.
type T_PtrStr_t = ^TZ_Str_t; compiles perfectly, while
type T_PtrStr_t = ^T_Str_t; generates a warning:
warning: identifiers should not start with an underscore
parse error before `;'
I have added the transcription of the session using an as small as possible
program. For clarity, the difference between the two source files
is the removal of the three Z's: two in the type declaration and one in the var
declaration.
Can someone point out what is wrong with the compilation of the second program?
Thanks in advance,
Marten Jan de Ruiter
mailto:m.j.deruiter@wbmt.tudelft.nl
37 % cat -n pointertypeOK.p
1 program pointertypeOK;
2
3 type
4 TZ_Str_t = string[6];
5 T_PtrStr_t = ^TZ_Str_t;
6
7 var s: TZ_Str_t;
8 p: T_PtrStr_t;
9
10 begin
11 s:='world!';
12 p:=addr(s);
13 writeln('hello ',p^);
14 end.
src 38 % gpc pointertypeOK.p -o pointertypeOK
src 39 % pointertypeOK
hello world!
src 41 % cat -n pointertypeNO.p
1 program pointertypeNO;
2
3 type
4 T_Str_t = string[6];
5 T_PtrStr_t = ^T_Str_t;
6
7 var s: T_Str_t;
8 p: T_PtrStr_t;
9
10 begin
11 s:='world!';
12 p:=addr(s);
13 writeln('hello ',p^);
14 end.
42 % gpc pointertypeNO.p -o pointertypeNO
pointertype.p:5: warning: identifiers should not start with an underscore
pointertype.p:5: parse error before `;'
pointertype.p:5: extra semicolon
pointertype.p:5: extra semicolon
pointertype.p:8: type name expected, identifier `T_ptrstr_t' given
pointertype.p: In function `program_Pointertype':
pointertype.p:12: incompatible types in assignment
pointertype.p:13: invalid type argument of ``^''