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

Re: dvd+rw-tools update [7.1]



i downloaded dvd+rw-tools-7.1.tar.gz to my 64 Bit
system and ran make.
This warning appeared

  gcc  -O2 -D_REENTRANT   -c -o growisofs.o growisofs.c
  In file included from growisofs.c:445:
  mp.h: In function '__thread_wait':
  mp.h:59: warning: cast from pointer to integer of different size

I read in mp.h :

  { void *ret;
      if (pthread_join((pthread_t)((size_t)h),&ret)==0)
          return (int)ret;

My compiler setup has: sizeof(int)==4, sizeof(void *)==8
so this is not a trivial warning.
I feel unable to evaluate the consequences of throwing
away half the bits of ret.

To start with function in question is not used in dvd+rw-tools (mp.h is reused from another application). Secondly it's all about convention within any given application. pthread_join simply receives value passed to pthread_exit and if you've passed 32-bit value to the latter it would be safe to cast it to int in the former.

Bottom line. Warning is safe to ignore. If you're still not comfortable get rid of __thread_wait altogether or cast as "(int)(size_t)ret;" A.


Reply to: