There's got to be a return type for both of these that actually makes
sense? As it stands, the Plan 9 native C compiler objects.
++L
PS: Plan 9 yacc objects to C++-type comments (//), I'm happy to submit
a patch that fixes this incompatibility.
s/return //
It's just a bug left over from when convlit and convlit1
did return things. Gcc apparently lets you do this.
Russ
Worked a treat. Thank you.
++L
/n/dump/2009/1120/sys/src/cmd/yacc.c:1918,1933 - yacc.c:1918,1940
/* i is the number of lines skipped */
i = 0;
- if(Bgetrune(finput) != '*')
- error("illegal comment");
c = Bgetrune(finput);
- while(c != Beof) {
- while(c == '*')
- if((c=Bgetrune(finput)) == '/')
- return i;
- if(c == '\n')
- i++;
+ if(c == '/'){
+ while((c = Bgetrune(finput)) != Beof)
+ if(c == '\n')
+ return 1;
+ }else{
+ if(c != '*')
+ error("illegal comment");
c = Bgetrune(finput);
+ while(c != Beof) {
+ while(c == '*')
+ if((c=Bgetrune(finput)) == '/')
+ return i;
+ if(c == '\n')
+ i++;
+ c = Bgetrune(finput);
+ }
}
error("EOF inside comment");
return 0;
and for 8a
/n/dump/2009/1120/sys/src/cmd/cc/lexbody:418,425 - /sys/src/cmd/cc/lexbody:418,424
for(;;) {
c = GETC();
if(c == '\n') {
- lineno++;
- goto l0;
+ goto l1; /* return ; for ?a's benefit. */
}
if(c == EOF) {
yyerror("eof in comment");
- erik