From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <4F1D1C4F.4040003@gmail.com> References: <4F171398.8020701@Princeton.EDU> <4F1D1C4F.4040003@gmail.com> Date: Mon, 23 Jan 2012 08:59:04 +0000 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=0015175ce0a215161004b72e3eb5 Subject: Re: [9fans] ape compiler error, IND CHAR and INT Topicbox-Message-UUID: 60a2c250-ead7-11e9-9d60-3106f5b1d025 --0015175ce0a215161004b72e3eb5 Content-Type: text/plain; charset=UTF-8 The line number is off-by-one, for some reason, but since the operation is AS (assign), and since the assignment from dlerror is on the next line, and dlerror won't be declared anywhere, that's most likely to be the problem. On 23 January 2012 08:37, Jens Staal wrote: > I get the same error no matter which BASIC file that gets generated to C > and it is put in the generated header file (at different row numbers, > ofcourse. I used test1 as use case to try to track it down), so there is > some sort of typedef inconsistency in there somewhere. I believe that it > has something to do with strndup and the "switch" function in the generated > header, but I am not sure exactly what. > > 2012-01-23 09:13, steve skrev: > > I must have missed that one, >> From your old report it seems tr problem is at line 432 of test1.bac.h >> >> Can you reproduce the error? >> >> -Steve >> >> On 23 Jan 2012, at 06:47 AM, Jens Staal wrote: >> >> 2012/1/18 John Floren: >>> >>>> On Wed, Jan 18, 2012 at 10:46 AM, Martin Harriss >>>> wrote: >>>> >>>>> John Floren wrote: >>>>> >>>>>> I figured I'd try building Python from the source on their website >>>>>> just for kicks. Configure went ok, but when I went to run "make", it >>>>>> soon bailed out with this error: >>>>>> >>>>>> cc -c -OPT:Olimit=0 -g -DNDEBUG -O -I. -IInclude -I./Include >>>>>> -DPy_BUILD_CORE -o Parser/grammar.o Parser/grammar.c >>>>>> cc: flag -P ignored >>>>>> cc: flag -: ignored >>>>>> cc: can't find library for -l >>>>>> /usr/john/Python-2.7.2/Parser/**grammar.c:46[stdin:12906] >>>>>> incompatible >>>>>> types: "IND CHAR" and "INT" for op "AS" >>>>>> /usr/john/Python-2.7.2/Parser/**grammar.c:108[stdin:12968] >>>>>> incompatible >>>>>> types: "IND CHAR" and "INT" for op "AS" >>>>>> cc: cpp: 8c 896765: error >>>>>> *** Error code 1 >>>>>> # >>>>>> >>>>>> The offending lines are these: >>>>>> >>>>>> d->d_name = strdup(name); >>>>>> and >>>>>> lb->lb_str = strdup(str); >>>>>> >>>>>> d_name and lb_str are both defined as char*, and strdup is supposed to >>>>>> return a char*. However, if I'm reading that error message correctly, >>>>>> it thinks strdup is trying to return a char*. Does anyone recognize >>>>>> what's going on? >>>>>> >>>>> >>>>> No declaration in scope for the string functions, compiler thinks they >>>>> return INT? >>>>> >>>>> Martin >>>>> >>>>> Yup, I r dum, needed a -D_BSD_EXTENSION in my flags to make string.h >>>> behave right. >>>> >>>> I have a similar issue with BaCon (a ksh script converting BASIC code >>> to C), a modified version running under APE sh can be found here: >>> >>> http://code.google.com/p/**ports2plan9/source/browse/**BaCon >>> >>> Also this one has the problem 'incompatible types "IND CONST CHAR" and >>> "INT" for op "AS"' >>> >>> and I have not been able to track down exactly where in the script >>> that the erroneous code gets generated. >>> >>> issue described here: >>> http://code.google.com/p/**ports2plan9/issues/detail?id=1 >>> >>> I have already added the -D_BSD_EXTENSION in the CFLAGS in the script. >>> >> > > --0015175ce0a215161004b72e3eb5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The line number is off-by-one, for some reason, but since the operation is = AS (assign), and since the assignment from dlerror is on the next line, and= dlerror won't be declared anywhere, that's most likely to be the p= roblem.

On 23 January 2012 08:37, Jens Staal <staal1978@gmail.com> wrote:
I get the same error no matter which BASIC file that gets generated to C an= d it is put in the generated header file (at different row numbers, ofcours= e. I used test1 as use case to try to track it down), so there is some sort= of typedef inconsistency in there somewhere. I believe that it has somethi= ng to do with strndup and the "switch" function in the generated = header, but I am not sure exactly what.

20= 12-01-23 09:13, steve skrev:
I must have missed that one,
=C2=A0From your old report it seems tr problem is at line 432 of test1.bac.= h

Can you reproduce the error?

-Steve

On 23 Jan 2012, at 06:47 AM, Jens Staal<staal1978@gmail.com> =C2=A0wrote:

2012/1/18 John Floren<john@jfloren.net>:
On Wed, Jan 18, 2012 at 10:46 AM, Martin Harriss<martin@princeton.edu> =C2=A0wrote= :
John Floren wrote:
I figured I'd try building Python from the source on their website
just for kicks. Configure went ok, but when I went to run "make",= it
soon bailed out with this error:

cc -c -OPT:Olimit=3D0 -g -DNDEBUG -O =C2=A0-I. -IInclude -I./Include
-DPy_BUILD_CORE -o Parser/grammar.o Parser/grammar.c
cc: flag -P ignored
cc: flag -: ignored
cc: can't find library for -l
/usr/john/Python-2.7.2/Parser/grammar.c:46[stdin:12906] incompatible=
types: "IND CHAR" and "INT" for op "AS"
/usr/john/Python-2.7.2/Parser/grammar.c:108[stdin:12968] incompatibl= e
types: "IND CHAR" and "INT" for op "AS"
cc: cpp: 8c 896765: error
*** Error code 1
#

The offending lines are these:

=C2=A0 =C2=A0d->d_name =3D strdup(name);
and
=C2=A0 =C2=A0lb->lb_str =3D strdup(str);

d_name and lb_str are both defined as char*, and strdup is supposed to
return a char*. However, if I'm reading that error message correctly, it thinks strdup is trying to return a char*. Does anyone recognize
what's going on?

No declaration in scope for the string functions, compiler thinks they
return INT?

Martin

Yup, I r dum, needed a -D_BSD_EXTENSION in my flags to make string.h
behave right.

I have a similar issue with BaCon (a ksh script converting BASIC code
to C), a modified version running under APE sh can be found here:

http://code.google.com/p/ports2plan9/source/browse/BaCon

Also this one has the problem 'incompatible types "IND CONST CHAR&= quot; and
"INT" for op "AS"'

and I have not been able to track down exactly where in the script
that the erroneous code gets generated.

issue described here:
http://code.google.com/p/ports2plan9/issues/detail?id= =3D1

I have already added the -D_BSD_EXTENSION in the CFLAGS in the script.



--0015175ce0a215161004b72e3eb5--