bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison 1.28b


From: Hans Aberg
Subject: Re: Bison 1.28b
Date: Sat, 4 Aug 2001 20:29:22 +0200

At 15:37 +0200 2001/08/04, Akim Demaille wrote:
>Hans> Also, for use with C++, I had to put in a prototype: #ifdef
>Hans> __cplusplus int yyparse(YYPARSE_PARAM_ARG); // Prototype.
>Hans> #endif which I put right before yyparse.
>
>??? Why?  I've never had this problem.

The C++ standard, verse 3.1:2, says that a definition is a declaration, so
prototypes would not be required then if there is definition before the use.

Under C though, when function prototypes are not required, no definition is
required either -- the compiler will just assume the code is correct.

So the sensible thing is to require prototypes under C, but not under C++.
But my compiler has a single button "require function prototypes" for both
C/C++. A similar problems happens with "enable bool support", which applies
to both C/C++: So I turned it off, assuming it only applies to C (as bool
is a part of the C++ standard). But then C++ template library code started
breaking (rather difficult to debug, incidentally).

I think those are bugs or shortcomings of the compiler I use; it should not
happen in GCC. But it may happen in compilers that try to integrate C/C++
too tightly.

  Hans Aberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]