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

Re: [libvirt] [PATCH] build: avoid shadowing devname() on BSD systems



On 04/12/2010, at 4:16 AM, Diego Elio Pettenò wrote:
> Il giorno sab, 04/12/2010 alle 04.08 +1100, Justin Clift ha scritto:
>> 
>> 
>>  ../daemon/event.c: In function 'virEventInterruptLocked':
>>  ../daemon/event.c:656: warning: cast from pointer to integer of
>> different size [-Wpointer-to-int-cast]
>> 
>>  event.c: In function 'virEventInterruptLocked':
>>  event.c:656: warning: cast from pointer to integer of different size
>> [-Wpointer-to-int-cast]
>> 
> These two should be considered _more_ than simply warnings, they can
> abort the software at runtime if used on 64-bit systems, so I'd suggest
> tackling these _sooner_ than the shadows (I don't have compile-access to
> my mac right now, or I'd be sending something myself).

Thanks.  They're from this piece of code:

    if (!eventLoop.running ||
        virThreadIsSelf(&eventLoop.leader)) {
        VIR_DEBUG("Skip interrupt, %d %d", eventLoop.running, (int)eventLoop.leader.thread);
        return 0;
    }

Like 656 is the VIR_DEBUG() line.

The eventLoop.running is defined earlier in the file as:

    int running;

Having trouble finding where eventLoop.leader.thread is defined though.  Probably because
I'm more sleepy than optimal.  Thinking it might be some kind of problem with OSX and gnulib?

Tracing things back manually shows this in the OSX provided /usr/include/pthread.h:

  #ifndef _PTHREAD_T
  #define _PTHREAD_T
  typedef __darwin_pthread_t              pthread_t;
  #endif

And this in the gnulib version, gnulib/lib/pthread.h:

 typedef int pthread_t;

Any idea if this on the right track, or am I just confusing myself? :)





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