[4982] in Athena Bugs
yaccb (yet another c compiler bug)
daemon@ATHENA.MIT.EDU (raeburn@ATHENA.MIT.EDU)
Thu May 24 14:39:49 1990
From: raeburn@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Thu, 24 May 90 14:39:32 EDT
------- Forwarded Message
From: guy%gorodish@Sun.COM (Guy Harris)
Subject: Re: pcc bug
> Bug: pcc compiles without complaint the program:
>
> main(x,y)
> int x, main;
> {
> printf("oops\n");
> }
Another one of many PCC front end problems. A fix, of sorts - it
causes the compiler at least to recognize that "main" is not given in
the argument list.
*** pftn.c Mon May 4 13:52:14 1987
- --- pftn.c.fixed Sat Jun 27 00:19:38 1987
***************
*** 93,116 ****
if( stp == FTN && p->sclass == SNULL )goto enter;
/* name encountered as function, not yet defined */
- - if( stp == UNDEF|| stp == FARG ){
- - if( blevel==1 && stp!=FARG ) switch( class ){
! default:
! /* "declared argument %.8s is missing" */
! /* "declared argument %s is missing" */
! if(!(class&FIELD)) UERROR( MESSAGE( 28 ), p->sname );
! case MOS:
! case STNAME:
! case MOU:
! case UNAME:
! case MOE:
! case ENAME:
! case TYPEDEF:
! ;
! }
! goto enter;
! }
if( type != stp ) goto mismatch;
/* test (and possibly adjust) dimensions */
- --- 93,116 ----
if( stp == FTN && p->sclass == SNULL )goto enter;
/* name encountered as function, not yet defined */
! if( blevel==1 && stp!=FARG ) switch( class ){
!
! default:
! /* "declared argument %.8s is missing" */
! /* "declared argument %s is missing" */
! if(!(class&FIELD)) UERROR( MESSAGE( 28 ), p->sname );
! case MOS:
! case STNAME:
! case MOU:
! case UNAME:
! case MOE:
! case ENAME:
! case TYPEDEF:
! ;
! }
!
! if( stp == UNDEF|| stp == FARG ) goto enter;
if( type != stp ) goto mismatch;
/* test (and possibly adjust) dimensions */
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
guy@sun.com
------- End of Forwarded Message