|
From: | Hans Aberg |
Subject: | Re: too many warnings from Bison CVS for Pike |
Date: | Tue, 31 Jan 2006 00:24:47 +0100 |
On 30 Jan 2006, at 23:31, Joel E. Denny wrote:
And a strict C++ compiler will complain whenusing names such as "malloc", as the C++ name is "std::malloc". Is your C++compiler old?Using g++ 4.0.1 (with -Wall -pedantic) or Sun's CC 5.7, the following compiles without warning: #include <stdlib.h> #include <stdio.h> int main() { int *p = (int*)malloc(3); printf ("%d\n", *p); return 0; } Perhaps you're thinking of <cstdlib> rather than <stdlib.h>?
You are sort of asking for reworking the different possibilities. If you want to support a compile C as C++ option, contact the developers. The problem is not that it impossible as such, but there is no-one willing to do the job. It could be that it is easier to do it now, when C++ compilers have better sorted out what the standard is saying.
You can use the C-compatibility headers, but that may cause problems for those that are using C++ namespaces. And the copy-constructor problem in the parser stack can be solved by implementing a deque instead instead of an array that is copied over, which does not need any copy-over when extending.
Hans Aberg
[Prev in Thread] | Current Thread | [Next in Thread] |