Re: GLib on Solaris

Darin Adler <> writes:

> > char * cp = <gpointer type pointer> does not compile.
> It's not standard C to refuse to allow this assignment. You are supposed to
> be able to assign from a void *, like gpointer, to another kind of pointer
> like char *. Not allowing this is one of the changes made by C++. Are you
> using your compiler in C++ mode or in some extra-picky mode?
> > Usually I explicitly cast like this:
> > 
> > char * cp = (char *) <gpointer type pointer>
> This is a fine coding style choice, but it shouldn't be required. That's one
> reason we have an ISO C standard, to prevent differences like this between
> compilers from causing trouble.
> On the other hand, the GLib maintainers may decide that they want these
> casts added so that compilers that don't comply with the standard still can
> be used to compile GLib. So you should wait to hear from them for a more
> definitive response.

We don't 

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