Re: GLib on Solaris

> 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.

    -- Darin

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