This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cpplib: K+R compile fixes and small performance tweaks


 > From: Zack Weinberg <zack@wolery.cumb.org>
 > 
 > On Wed, Jul 12, 2000 at 04:46:29PM -0400, Kaveh R. Ghazi wrote:
 > >  > From: Zack Weinberg <zack@wolery.cumb.org>
 > >  > 
 > >  > cppexp.c had excessively clever macro constructs which some pre-ANSI
 > >  > compilers rejected.  I would like to add a -Wtraditional warning for
 > >  > this, but it's not clear to me exactly what the problem was.
 > >  > zw
 > > 
 > > There were two problems.  One was "unary plus" which is an ANSIism.
 > > I just checked in a patch to have -Wtraditional warn about this.
 > 
 > Should it be warned about inside #if expressions, too?

Good catch, yes it should.
This code:

 > #if +5
 > foo
 > #endif

with SunOS4 cc -E yields:  syntax error (in preprocessor if)


 > 
 > > The second problem was reported on nextstep, which I though used gcc
 > > as its compiler.  It complained about function macros whose defined
 > > arguments were missing/empty.
 > > 
 > > http://gcc.gnu.org/ml/gcc-bugs/2000-07/msg00258.html
 > > 
 > > I don't think this one is a traditional C problem since my K&R
 > > compiler accepted it fine.
 > 
 > Probably a bug in that compiler.
 > zw

Well, AFAIK that compiler is gcc (albeit pre or very early 2.x.)  Not
that gcc is bug free mind you, it's just interesting to note this
especially since you just inserted tradcpp.c which may or may not
contain the same problem.

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]