Hi, Rayson Thanks for your reply! Yes, but in some benchmark, like Spec2006, there are some code written like this, and the C++ compiler can not tackle them. For C program, if I add some C++ code, how should I do? Because the C parts have some characters that C++ does not support, like" char* = void *", which need explicit transform for C++ compiler. Compile C part with gcc and the C++ part with g++, then link them together, it seems not work.
Eric > -----Original Message----- > From: Rayson Ho [mailto:raysonlo...@yahoo.com] > Sent: Monday, November 07, 2011 11:26 PM > To: eirc....@gmail.com; open64-devel@lists.sourceforge.net > Subject: Re: [Open64-devel] do someone know why declare like below > > Yes, that's the old "K&R" style C function definition. ANSI standard uses the > newer and IMO cleaner style, and is now used by everyone (almost!). > > The compiler should generate idential code no matter you write in K&R style > or ANSI style. > > Rayson > > ================================= > Grid Engine / Open Grid Scheduler > http://gridscheduler.sourceforge.net > > > > ----- Original Message ----- > From: shenrfen <shenr...@gmail.com> > To: eirc....@gmail.com; open64-devel@lists.sourceforge.net > Cc: > Sent: Monday, November 7, 2011 9:07 PM > Subject: Re: [Open64-devel] do someone know why declare like below > > This is the old style function definition in C language > > -----Original Message----- > From: eirc....@gmail.com [mailto:eirc....@gmail.com] > Sent: Tuesday, November 08, 2011 4:01 AM > To: open64-devel@lists.sourceforge.net > Subject: [Open64-devel] do someone know why declare like below > > Hi, > > I find in some application, the programmer define a function like below, > why they put the type of parameter after the parameter list. > > static char * > reg(cp, paren, flagp) > register struct comp *cp; > int paren; /* Parenthesized? */ > int *flagp; > { > > .. > .. > Return .... > } > > Thanks! > > Eric > > > ---------------------------------------------------------------------------- > -- > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > Open64-devel mailing list > Open64-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/open64-devel > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > Open64-devel mailing list > Open64-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/open64-devel ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel