Menu

Compilation warning on 64 bit systems

kecsap
2014-09-26
2014-12-26
  • kecsap

    kecsap - 2014-09-26

    Hi,

    I get the following warnings on Ubuntu 64 bit system:

    lwpr_mem.c: In function ‘lwpr_mem_alloc_rf’:
    lwpr_mem.c:50:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
    if (((int)((void ) storage)) & 8) storage++;
    ^
    lwpr_mem.c:82:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
    if (((int)((void
    ) storage)) & 8) storage++;
    ^
    lwpr_mem.c: In function ‘lwpr_mem_realloc_rf’:
    lwpr/src/lwpr_mem.c:118:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
    if (((int)((void ) storage)) & 8) storage++;
    ^
    lwpr_mem.c: In function ‘lwpr_mem_alloc_model’:
    lwpr_mem.c:186:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
    if (((int)((void
    ) storage)) & 8) storage++;
    ^
    lwpr_mem.c: In function ‘lwpr_mem_alloc_ws’:
    lwpr_mem.c:282:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
    if (((int)((void *) storage)) & 8) storage++;

    It is because the int type is 32 bit on these systems and the pointers are 64 bit.

    What would be the appropriate fix for this?

    Thanks,
    Csaba

     
  • Matthew Howard

    Matthew Howard - 2014-12-26

    Many thanks for filing this, Csaba. We have posted a fix to this in the latest release (lwpr-1.2.6).

    -Matthew

     

Log in to post a comment.

MongoDB Logo MongoDB