I'll come back to mem/tlsf_malloc.c issue. Camille asked if the compiler warnings on mem/tlsf_malloc.c were occurring on x86 32 bit machine. I now tried and, yes, they do not appear on i386 jessie, but not on amd64 jessie. So looks like this is the same issue that Ovidiu has reported.
-- Juha
Can you try with master branch and see if the warning for tlsf malloc disappeared? I changed the prototypes of malloc functions to use size_t to be compatible with standard malloc(). Changes are only in master branch.
Cheers, Daniel
On 21/05/16 22:11, Juha Heinanen wrote:
I'll come back to mem/tlsf_malloc.c issue. Camille asked if the compiler warnings on mem/tlsf_malloc.c were occurring on x86 32 bit machine. I now tried and, yes, they do not appear on i386 jessie, but not on amd64 jessie. So looks like this is the same issue that Ovidiu has reported.
-- Juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla writes:
Can you try with master branch and see if the warning for tlsf malloc disappeared? I changed the prototypes of malloc functions to use size_t to be compatible with standard malloc(). Changes are only in master branch.
The warning are now gone:
CC (gcc) [sip-proxy] mem/ll_malloc.o CC (gcc) [sip-proxy] mem/mem.o CC (gcc) [sip-proxy] mem/pkg.o CC (gcc) [sip-proxy] mem/sf_malloc.o CC (gcc) [sip-proxy] mem/q_malloc.o CC (gcc) [sip-proxy] mem/shm.o CC (gcc) [sip-proxy] mem/dl_malloc.o CC (gcc) [sip-proxy] mem/tlsf_malloc.o CC (gcc) [sip-proxy] mem/f_malloc.o CC (gcc) [sip-proxy] mem/memtest.o CC (gcc) [sip-proxy] mem/shm_mem.o
Thanks, Juha
I let compile go through all modules that I use and noticed that now also tls module warning are gone! That is great. The only remaining ones are on cfg/cfg_ctx.
-- Juha
CC (gcc) [sip-proxy] cfg/cfg_ctx.o cfg/cfg_ctx.c: In function 'cfg_set_now': cfg/cfg_ctx.c:485:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] group_inst = (cfg_group_inst_t *)translate_pointer((char *)new_array, ^ cfg/cfg_ctx.c:489:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CFG_GROUP_META(block, group)->array = new_array; ^ cfg/cfg_ctx.c:559:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] if (block && (CFG_GROUP_META(block, group)->array != CFG_GROUP_META(*cfg_global, group)->array)) ^ cfg/cfg_ctx.c:559:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] cfg/cfg_ctx.c:560:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] new_array = CFG_GROUP_META(block, group)->array; ^ cfg/cfg_ctx.c:579:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] replaced[i] = CFG_GROUP_META(*cfg_global, group)->array; ^ cfg/cfg_ctx.c: In function 'cfg_commit': cfg/cfg_ctx.c:1120:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] if (!(CFG_GROUP_META(block, group)->array = ^ cfg/cfg_ctx.c:1128:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] replaced[replaced_num] = CFG_GROUP_META(*cfg_global, group)->array; ^ cfg/cfg_ctx.c:1180:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] && (CFG_GROUP_META(block, changed->group)->array != CFG_GROUP_META(*cfg_global, changed->group)->array) ^ cfg/cfg_ctx.c:1180:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] cfg/cfg_ctx.c:1185:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] replaced[replaced_num] = CFG_GROUP_META(*cfg_global, group)->array; ^ cfg/cfg_ctx.c:1220:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] if (CFG_GROUP_META(block, group)->array ^ cfg/cfg_ctx.c:1221:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] && (CFG_GROUP_META(block, group)->array != CFG_GROUP_META(*cfg_global, group)->array) ^ cfg/cfg_ctx.c:1221:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] cfg/cfg_ctx.c:1223:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] shm_free(CFG_GROUP_META(block, group)->array); ^ cfg/cfg_ctx.c: In function 'cfg_add_group_inst': cfg/cfg_ctx.c:1577:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CFG_GROUP_META(block, group)->array = new_array; ^ cfg/cfg_ctx.c:1578:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CFG_GROUP_META(block, group)->num++; ^ cfg/cfg_ctx.c:1580:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] if (CFG_GROUP_META(*cfg_global, group)->array) { ^ cfg/cfg_ctx.c:1589:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] replaced[0] = CFG_GROUP_META(*cfg_global, group)->array; ^ cfg/cfg_ctx.c: In function 'cfg_del_group_inst': cfg/cfg_ctx.c:1673:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CFG_GROUP_META(block, group)->array = new_array; ^ cfg/cfg_ctx.c:1674:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] CFG_GROUP_META(block, group)->num--; ^ cfg/cfg_ctx.c:1676:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] if (CFG_GROUP_META(*cfg_global, group)->array) { ^ cfg/cfg_ctx.c:1687:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] && (*(char **)(group_inst->vars + var->offset) != NULL) ^ cfg/cfg_ctx.c:1705:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] && (*(char **)(group_inst->vars + var->offset) != NULL) ^ cfg/cfg_ctx.c:1707:6: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] replaced[num] = *(char **)(group_inst->vars + var->offset); ^ cfg/cfg_ctx.c:1713:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] replaced[num] = CFG_GROUP_META(*cfg_global, group)->array; ^