debian jessie gcc issues the compiler warnings below. i have not
incluced tls module warnings, since they have been there forever.
-- juha
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;
^
CC (gcc) [M app_lua.so] app_lua_exp.o
app_lua_exp.c: In function 'lua_sr_ndb_mongodb_free_reply':
app_lua_exp.c:2782:29: warning: array subscript is above array bounds [-Warray-bounds]
param[0].len = strlen(param[4].s);
^
app_lua_exp.c: In function 'lua_sr_ndb_mongodb_next_reply':
app_lua_exp.c:2755:29: warning: array subscript is above array bounds [-Warray-bounds]
param[0].len = strlen(param[4].s);
^
CC (gcc) [L libsrutils.so.1.0] sha256.o
sha256.c: In function 'SHA256_Final':
sha256.c:613:3: warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
*(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] =
context->bitcount;
^
sha256.c: In function 'SHA512_Last':
sha256.c:930:2: warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
*(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] =
context->bitcount[1];
^
sha256.c:931:2: warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
*(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] =
context->bitcount[0];
^
CC (gcc) [L libbinrpc.so.0.1] binrpc_api.o
binrpc_api.c: In function 'binrpc_response_to_text':
binrpc_api.c:1055:6: warning: 'val.u.strval.len' may be used uninitialized in this
function [-Wmaybe-uninitialized]
if(realloc_buf(buf, buf_len, data_len) != 0) {
^
binrpc_api.c:1143:20: note: 'val.u.strval.len' was declared here
struct binrpc_val val;
^