delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/02/06:18:21

Date: Sun, 2 Mar 1997 13:11:14 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Paul Derbyshire <ao950 AT FreeNet DOT Carleton DOT CA>
cc: djgpp AT delorie DOT com
Subject: Re: QUESTION: General Syntax
In-Reply-To: <5f5jml$bvd@freenet-news.carleton.ca>
Message-ID: <Pine.SUN.3.91.970302131051.6609G-100000@is>
MIME-Version: 1.0

On 28 Feb 1997, Paul Derbyshire wrote:

> I had an old version of PCC two or three years ago before I got DJGPP.
> It used a funny syntax:
> 
> int main:
>   int argc;
>   char *argv[];
> {
>   function stuff
> }

You mean this, I suppose:

	int main (argc, argv)
	    int argc;
	    char *argv[];
	{
	  function stuff
	}

> On doing some research I learned PCC  was using the ancient K&R syntax
> from the pre-ANSI days. Needless to say GCC uses ANSI instead.

GCC also accepts the K&R syntax, unless you add both -ansi and
-pedantic options to its command line.  So the above should compile
with GCC.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019