"unlikely" fails to compile with --with-debug on Ununtu

Bug #456084 reported by Mark Atwood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmemcached
Invalid
Undecided
Unassigned

Bug Description

Trying to build from bzr revno: 608 on ubuntu jaunty on EC2 (ami-0d729464). Uses gcc version 4.3.3

When doing ./configure --with-debug && make

lots of compile failures regarding "unlikely()"

as an example:

memcached_fetch.c: In function ‘memcached_fetch’:
memcached_fetch.c:11: error: conversion to ‘long int’ from ‘uint32_t’ may change the sign of the result [-Wsign-conversion]
memcached_fetch.c: In function ‘memcached_fetch_result’:
memcached_fetch.c:48: error: conversion to ‘long int’ from ‘uint32_t’ may change the sign of the result [-Wsign-conversion]

Revision history for this message
Monty Taylor (mordred) wrote : Re: [Bug 456084] [NEW] "unlikely" fails to compile with --with-debug on Ununtu

Mark Atwood wrote:
> Public bug reported:
>
> Trying to build from bzr revno: 608 on ubuntu jaunty on EC2 (ami-
> 0d729464). Uses gcc version 4.3.3
>
> When doing ./configure --with-debug && make
>
> lots of compile failures regarding "unlikely()"
>
> as an example:
>
> memcached_fetch.c: In function ‘memcached_fetch’:
> memcached_fetch.c:11: error: conversion to ‘long int’ from ‘uint32_t’ may change the sign of the result [-Wsign-conversion]
> memcached_fetch.c: In function ‘memcached_fetch_result’:
> memcached_fetch.c:48: error: conversion to ‘long int’ from ‘uint32_t’ may change the sign of the result [-Wsign-conversion]

This is actually not related to unlikey() at all. This is releated to
the AND operator (&) being applied to a uint32_t and an enum.

One can work around this by doing a cast to uint32_t on the enum value.

Revision history for this message
Trond Norbye (trond-norbye) wrote :

If it isn't related to unlikely() at all... why do it go away if you replace unlikely() with if() ?

Brian Aker (brianaker)
Changed in libmemcached:
status: New → Incomplete
Brian Aker (brianaker)
Changed in libmemcached:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.