I'm working on code to implement the new buffer APIs and have the following
internal function:
#if UINTPTR_MAX == 0xffffffffffffffff
#define odp_at odp_atomic_u64_t
#define odp_cs(p,o,n) odp_atomic_cmpset_u64((odp_at
*)(p),(uint64_t)(o),(uint64_t)(n))
#else
#define odp_at odp_atomic_u32_t
#define odp_cs(p,o,n) odp_atomic_cmpset_u32((odp_at
*)(p),(uint32_t)(o),(uint32_t)(n))
#endif
static inline void *get_block(struct pool_entry_s *pool)
{
void volatile *oldhead;
void volatile *newhead;
do {
oldhead = pool->blk_freelist;
if (oldhead == NULL) break;
newhead = ((odp_buf_blk_t *)oldhead)->next;
} while (odp_cs(pool->blk_freelist,oldhead,newhead) == 0);
return (void *)oldhead;
}
However when compiling this generates the following strange error message:
./include/odp_buffer_pool_internal.h: In function 'get_block':
./include/odp_buffer_pool_internal.h:88:14: error: cast discards
'__attribute__((noreturn))' qualifier from pointer target type
[-Werror=cast-qual]
newhead = ((odp_buf_blk_t *)oldhead)->next;
^
odp_buf_blk_t is declared as:
typedef struct odp_buf_blk_t {
struct odp_buf_blk_t *next;
struct odp_buf_blk_t *prev;
} odp_buf_blk_t;
As far as I know _attribute__((noreturn)) applies to functions, not
variables, so I don't understand this message.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383 reports this type of
behavior as a compiler bug against gcc v4.7 however gcc -v shows I'm
running gcc v4.8.1.
Suggestions?
Thanks.
bill
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp