🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #550

Re: pcc bug

#550
From: Guy Harris
Date: Sun, 28 Jun 1987 05:12
68 lines
2190 bytes
> 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
Technical Details
Message-ID: <22254@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!mit-eddie!ll-xn!ames!oliveb!sun!gorodish!guy
References: <1781@megaron.arizona.edu>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!mit-eddie!ll-xn!ames!oliveb!sun!gorodish!guy
From: guy%gorodish@Sun.COM (Guy Harris)
Newsgroups: comp.bugs.sys5
Subject: Re: pcc bug
Message-ID: <22254@sun.uucp>
Date: Sun, 28-Jun-87 01:12:25 EDT
Article-I.D.: sun.22254
Posted: Sun Jun 28 01:12:25 1987
Date-Received: Sun, 28-Jun-87 09:39:55 EDT
References: <1781@megaron.arizona.edu>
Sender: news@sun.uucp
Lines: 68