help-bison
[Top][All Lists]
Advanced

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

Re: malloc: bison-2.1+, prototype mismatch vs. stdlib.h (C++ mode)


From: Hans Aberg
Subject: Re: malloc: bison-2.1+, prototype mismatch vs. stdlib.h (C++ mode)
Date: Fri, 19 Oct 2007 23:17:02 +0200

On 19 Oct 2007, at 21:54, David Fang wrote:

I've just encountered a problem where the compiler rejects bison's prototype for "void* malloc(YYSIZE_T);" because it doesn't match with <stdlib.h>, which looks like "void* malloc(size_t) __THROW ... ;" (ubuntu7). The problem only manifests when compiling the resulting source file as in C++ (otherwise, the __THROW macro is empty). It looks like the bison skeleton is using "defined __cplusplus" to conditionally insert this prototype, rather than including <cstdlib>, a standard C++ wrapper header, which should resolve the inconsistency, and be safely portable. This issue is the same on at least 2.1 and 2.3. Does anyone else see this issue on ubuntu7 or other UNIX system? (Another ubuntu7 distro didn't have this issue, so I need to get more feedback from my bug reporter.)

Well, is it the C or C++ header? In C++, standard names start with "std::".

  Hans Aberg







reply via email to

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