[9fans] C compiler error?

2011-12-13 Thread Lucio De Re
New features in Go require a new function in the reflect.c module
(src/cmd/gc/reflect.c).  The C compiler (8c, in this case) reports an
error which does not seem to apply:

8c -I/go/include -I/go/386/include -FTVw ../gc/reflect.c
../gc/reflect.c:987 switch expression must be integer

This is a bit of a stumbling block.  I'm hoping there's someone on
this mailing list that can address this problem quicker than it would
be possible for me.  More details off line.

++L




Re: [9fans] C compiler error?

2011-12-13 Thread erik quanstrom
On Tue Dec 13 07:43:08 EST 2011, lu...@proxima.alt.za wrote:
 New features in Go require a new function in the reflect.c module
 (src/cmd/gc/reflect.c).  The C compiler (8c, in this case) reports an
 error which does not seem to apply:
 
 8c -I/go/include -I/go/386/include -FTVw ../gc/reflect.c
 ../gc/reflect.c:987 switch expression must be integer
 
 This is a bit of a stumbling block.  I'm hoping there's someone on
 this mailing list that can address this problem quicker than it would
 be possible for me.  More details off line.

i don't see 987 lines in reflect.c.  from 
http://golang.org/src/cmd/gc/reflect.c,
i only see 939.

in any event, it's likely that your switch type is a uvlong.  8c doesn't allow
that.

- erik



Re: [9fans] C compiler error?

2011-12-13 Thread Noah Evans
Erik, are you looking at the tip? IIRC the webpage points to a stable
version not the tip.

Noah



On Tue, Dec 13, 2011 at 2:36 PM, erik quanstrom quans...@quanstro.net wrote:
 On Tue Dec 13 07:43:08 EST 2011, lu...@proxima.alt.za wrote:
 New features in Go require a new function in the reflect.c module
 (src/cmd/gc/reflect.c).  The C compiler (8c, in this case) reports an
 error which does not seem to apply:

 8c -I/go/include -I/go/386/include -FTVw ../gc/reflect.c
 ../gc/reflect.c:987 switch expression must be integer

 This is a bit of a stumbling block.  I'm hoping there's someone on
 this mailing list that can address this problem quicker than it would
 be possible for me.  More details off line.

 i don't see 987 lines in reflect.c.  from 
 http://golang.org/src/cmd/gc/reflect.c,
 i only see 939.

 in any event, it's likely that your switch type is a uvlong.  8c doesn't allow
 that.

 - erik




Re: [9fans] C compiler error?

2011-12-13 Thread Anthony Martin
Lucio De Re lu...@proxima.alt.za once said:
 New features in Go require a new function in the reflect.c module
 (src/cmd/gc/reflect.c).  The C compiler (8c, in this case) reports an
 error which does not seem to apply:
 
 8c -I/go/include -I/go/386/include -FTVw ../gc/reflect.c
 ../gc/reflect.c:987 switch expression must be integer
 
 This is a bit of a stumbling block.  I'm hoping there's someone on
 this mailing list that can address this problem quicker than it would
 be possible for me.  More details off line.

Yup.  8c won't allow this.  If you we're using 6c
you could have a vlong in a switch expression.

I sent out a CL for this:
https://codereview.appspot.com/5486049/

  Anthony



Re: [9fans] C compiler error?

2011-12-13 Thread erik quanstrom
On Tue Dec 13 08:53:25 EST 2011, noah.ev...@gmail.com wrote:
 Erik, are you looking at the tip? IIRC the webpage points to a stable
 version not the tip.

well too bad, no option to peek at the tip either.

in any event, i still bet you're switching on a uvlong.

- erik



Re: [9fans] C compiler error?

2011-12-13 Thread yy
2011/12/13 erik quanstrom quans...@quanstro.net:
 On Tue Dec 13 08:53:25 EST 2011, noah.ev...@gmail.com wrote:
 Erik, are you looking at the tip? IIRC the webpage points to a stable
 version not the tip.

 well too bad, no option to peek at the tip either.


http://tip.golang.org/src/cmd/gc/reflect.c

(weekly.golang.org is there too)


-- 
- yiyus || JGL .



Re: [9fans] C compiler error?

2011-12-13 Thread Charles Forsyth
it's reasonable to use any integer type in a switch, although the compilers
don't currently support it.
it's compatible with the standard, which allows any integer type. i'd
cancel the change request and work round it (add a cast) until
the compilers can be changed to support it.


Re: [9fans] C compiler error?

2011-12-13 Thread Russ Cox
On Tue, Dec 13, 2011 at 5:38 PM, Charles Forsyth
charles.fors...@gmail.com wrote:
 it's reasonable to use any integer type in a switch, although the compilers
 don't currently support it.
 it's compatible with the standard, which allows any integer type. i'd cancel
 the change request and work round it (add a cast) until
 the compilers can be changed to support it.

http://codereview.appspot.com/5485063/ is a step toward it.
it doesn't generate the prettiest code but i think it works.

russ



Re: [9fans] C compiler error?

2011-12-13 Thread Lucio De Re
Was meant as private mail, sorry!

++L
---BeginMessage---
 On Tue, Dec 13, 2011 at 5:38 PM, Charles Forsyth
 (add a cast) until
 the compilers can be changed to support it.
 
 http://codereview.appspot.com/5485063/ is a step toward it.
 it doesn't generate the prettiest code but i think it works.
 
What is the expected status?  Is Anthony's CL to be abandoned in
favour of the change to the Plan 9 C compiler (give or take the other
nit of a static definition)?  I don't have a problem with minor
unofficial changes to the Plan 9 distribution, but others may object.

Lucio.
---End Message---


Re: [9fans] C compiler error?

2011-12-13 Thread Russ Cox
On Tue, Dec 13, 2011 at 11:05 PM, Lucio De Re lu...@proxima.alt.za wrote:
 What is the expected status?  Is Anthony's CL to be abandoned in
 favour of the change to the Plan 9 C compiler (give or take the other
 nit of a static definition)?  I don't have a problem with minor
 unofficial changes to the Plan 9 distribution, but others may object.

Since you sent this publicly, I will reply publicly.
We're not going to change the Go code to avoid
switches on 64-bit numbers, which are increasingly
common.  I assume that Anthony will take care of
submitting the patch through the usual channels
and getting it applied.

Russ