|
From: | David Fang |
Subject: | malloc: bison-2.1+, prototype mismatch vs. stdlib.h (C++ mode) |
Date: | Fri, 19 Oct 2007 15:54:34 -0400 (EDT) |
Hi,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.)
Fang David Fang Computer Systems Laboratory Electrical & Computer Engineering Cornell University http://www.csl.cornell.edu/~fang/ -- (2400 baud? Netscape 3.0?? lynx??? No problem!)
[Prev in Thread] | Current Thread | [Next in Thread] |