J
James Kuyper
Ezekiel said:sun:~>g++ --version
g++ (GCC) 3.4.1
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sun:~>g++ foo.cpp
foo.cpp: In function `int main(int, char**)':
foo.cpp:6: error: invalid conversion from `void*' to `char*'
sun:~>
6: char* buff = malloc(512);
He specified "perfectly legal code". You're compiling it as C++ code
(which is off-topic in comp.lang.c, though probably not in the other
cross-posted groups). In C++, that code does not qualify: it violates a
constraint.