Re: gsize vs. size_t



On Tue, Feb 19, 2002 at 04:39:20PM +0100, Miroslaw Dobrzanski-Neumann wrote:
> Hi
> I get the followin errors when compiling on AIX
> 
> it is because size_t is unsigned long and gsize is unsigned int at when calling g_iconv()
> 
> glib-1.3.14/glib/giochannel.c
> 
> xlc_r -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -I/net/DAGOBERT/dataE3/bef/mne/SYSTEM/include -g -D_REENTRANT -D_THREAD_SAFE -c giochannel.c  -DPIC
> "giochannel.c", line 1246.51: 1506-280 (E) Function argument assignment between types "unsigned int*" and "unsigned long*" is not allowed.

	Yay ANSI!  What's happening here is that configure.in does
GLIB_SIZEOF(size_t).  That does sizeof(size_t), which is 4 on a 32-bit
RS/6000.  configure.in then does:

case x$glib_size_t in
   x4) typedef guint32 gsize

But because ints are 32 bits, guint32 is typedef unsigned int guint32.
So, the resolved typedefs are:

typedef unsigned long size_t
typedef unsigned int gsize

These are the same size (32 bits), but the compiler notices they are
different types and is very strict in warning.
	This isn't going to go away unless glib gets a macro to use the
string definition of size_t or something else like that.  I don't see it
happening in the near term.  You can ignore these warnings, or you can
hunt up the right -q option to lower your warning level.

Joel


-- 

"Where are my angels?
 Where's my golden one?
 And where is my hope
 Now that my heroes are gone?"

			http://www.jlbec.org/
			jlbec evilplan org



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