On 09/05/2012 11:22 AM, Alan Coopersmith wrote:
On 09/ 5/12 10:16 AM, Matt Turner wrote:
On Wed, Sep 5, 2012 at 7:30 AM, Brian Paul<bri...@vmware.com>  wrote:
So assigning a void pointer to a non-void pointer is legal in C and illegal
in C++.  I seem to recall some people compiling all of Mesa with C++ in some
situations in the past.  Also, there were some C compiler(s) years ago that
required these casts (can't remember which).

That would be interesting to know.

The historical problem I remember was pre-ANSI C89, when compilers either didn't
have (void *) so had malloc return (char *) or didn't have a header providing a
declaration of malloc before C added function prototypes.   I don't think any
such compilers can still be used to build Mesa.

That's probably true. In the early days I was using HP, IBM, IRIX, Sun, DEC, etc. compilers and they all had their idiosyncrasies. Linux/gcc was one of the later platforms for Mesa, actually.

I don't think we've been 100% consistent about casting the results of malloc() and nobody's complained so it's probably fine.

And I don't recall who/why someone needed to compile all of Mesa as C++.

-Brian
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to