Version 8 (modified by mikehh, 5 years ago)

latest warnings at r41266

Warnings seen during the build don't necessarily warrant tickets of their own, since they aren't breaking the build. However, one of our goals is to have a (nearly) warnings-free build, so if your build has warnings, document them here, and someone may eventually be able to avoid them.

The following warnings appear for me (Infinoid) on x86-64 gentoo linux, but are caused by system headers and thus are not Parrot's fault:

src/thread.c: In function 'pt_thread_join':
src/thread.c:1381: warning: suggest braces around empty body in 'do' statement
./gdbmhash.pmc: In function 'Parrot_GDBMHash_get_string_keyed':
./gdbmhash.pmc:238: warning: function call has aggregate value
./gdbmhash.pmc: In function 'Parrot_GDBMHash_get_bool':
./gdbmhash.pmc:176: warning: function call has aggregate value
./gdbmhash.pmc: In function 'Parrot_GDBMHash_get_integer':
./gdbmhash.pmc:150: warning: function call has aggregate value
./gdbmhash.pmc:152: warning: function call has aggregate value

The following warnings are in IMCC, and have never gotten much attention because IMCC will eventually be deprecated:

compilers/imcc/imcparser.c: In function 'yyparse':
compilers/imcc/imcparser.c:2848: warning: statement with no effect
compilers/imcc/imcparser.c:4938: warning: logical '&&' with non-zero constant wi
ll always evaluate as true
compilers/imcc/imcparser.c:4941: warning: statement with no effect
compilers/imcc/imcparser.c:5098: warning: statement with no effect
compilers/imcc/imcparser.c:5102: warning: statement with no effect
compilers/imcc/imclexer.c: In function 'yy_get_next_buffer':
compilers/imcc/imclexer.c:4165: warning: comparison between signed and unsigned

The following warning is also in IMCC, but is really caused by headerizer not understanding #if blocks:

compilers/imcc/pbc.c:181: warning: 'old_blocks' declared 'static' but never defined

I (mikehh) got the following warnings at r37645 - most have been around for quite awhile, some duplicating the ones above (Infinoid), but also some additional ones.
built with - make world 2>&1 | tee make_world.37645.log
Kubuntu Intrepid i386 gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)

src/nci.c:3016: warning: dereferencing type-punned pointer will break strict-aliasing rules
src/nci.c:5194: warning: dereferencing type-punned pointer will break strict-aliasing rules
src/nci.c:5805: warning: dereferencing type-punned pointer will break strict-aliasing rules

src/thread.c:1381: warning: suggest braces around empty body in ‘do’ statement
src/thread.c:499: warning: variable ‘sub_pmc’ might be clobbered by ‘longjmp’ or ‘vfork’

src/jit_defs.c:2069: warning: logical ‘&&’ with non-zero constant will always evaluate as true
src/jit_defs.c:2080: warning: logical ‘&&’ with non-zero constant will always evaluate as true

./src/pmc/sub.pmc:891: warning: logical ‘&&’ with non-zero constant will always evaluate as true

compilers/imcc/imcc.y:739: warning: unused parameter ‘interp’
compilers/imcc/imcparser.c:2848: warning: statement with no effect
compilers/imcc/imcparser.c:4938: warning: logical ‘&&’ with non-zero constant will always evaluate as true
compilers/imcc/imcparser.c:4941: warning: statement with no effect
compilers/imcc/imcparser.c:5098: warning: statement with no effect
compilers/imcc/imcparser.c:5102: warning: statement with no effect
compilers/imcc/imcc.l:731: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
compilers/imcc/imclexer.c:4165: warning: comparison between signed and unsigned
compilers/imcc/imcc.l:1306: warning: variable ‘buffer’ might be clobbered by ‘longjmp’ or ‘vfork’
compilers/imcc/imcc.l:1338: warning: variable ‘buffer’ might be clobbered by ‘longjmp’ or ‘vfork’

compilers/imcc/instructions.c:176: warning: logical ‘&&’ with non-zero constant will always evaluate as true

compilers/imcc/reg_alloc.c:738: warning: logical ‘&&’ with non-zero constant will always evaluate as true

./gdbmhash.pmc:238: warning: function call has aggregate value
./gdbmhash.pmc:176: warning: function call has aggregate value
./gdbmhash.pmc:150: warning: function call has aggregate value
./gdbmhash.pmc:152: warning: function call has aggregate value

myops_ops_switch.c:151: warning: dereferencing type-punned pointer will break strict-aliasing rules

pbc_to_exe.c:391: warning: dereferencing type-punned pointer might break strict-aliasing rules

parrot_config.c:86: warning: dereferencing type-punned pointer might break strict-aliasing rules

dukeleto: some warnings that I get during the build on OS X 10.5.8/GMP 4.3.1 :

src/pmc/bignum.c
In file included from ./src/pmc/bignum.pmc:148:
/opt/local/include/gmp.h:431:74: warning: "__STDC_VERSION__" is not defined
In file included from ./src/pmc/bigint.pmc:32:
/opt/local/include/gmp.h:431:74: warning: "__STDC_VERSION__" is not defined

compilers/imcc/imcparser.c: In function ‘yyparse’:
compilers/imcc/imcparser.c:3092: warning: statement with no effect
compilers/imcc/imcparser.c:5230: warning: statement with no effect
compilers/imcc/imcparser.c:5387: warning: statement with no effect
compilers/imcc/imcparser.c:5391: warning: statement with no effect
compilers/imcc/imcc.y:1360: warning: ignoring return value of ‘iSUBROUTINE’, declared with attribute warn_unused_result

compilers/imcc/pbc.c:184: warning: ‘old_blocks’ declared ‘static’ but never defined


mikehh: latest warnings at r41266, built with g++ (Ubuntu 4.3.3-5ubuntu4) 4.3.3 on Ubuntu 9.04 amd64

the only difference with a build at parrot r41265 on Ubuntu 9.04 i386 (also using g++) is that the first two warnings for src/nci.c do not occur there, the third does

from: tools/build/ops2pm.pl
trap                      1258       experimental, not in ops.num

src/ops/core_ops_switch.c:13010: warning: dereferencing type-punned pointer will break strict-aliasing rules

src/interp/inter_misc.c:210: warning: ‘ret’ may be used uninitialised in this function

src/nci.c:4597: warning: dereferencing type-punned pointer will break strict-aliasing rules
src/nci.c:5136: warning: dereferencing type-punned pointer will break strict-aliasing rules
src/nci.c:11030: warning: dereferencing type-punned pointer will break strict-aliasing rules

src/pmc_freeze.c:523: warning: dereferencing type-punned pointer will break strict-aliasing rules

compilers/imcc/imcparser.c:3092: warning: statement has no effect
compilers/imcc/imcparser.c:5230: warning: statement has no effect
compilers/imcc/imcparser.c:5387: warning: statement has no effect
compilers/imcc/imcparser.c:5391: warning: statement has no effect
compilers/imcc/imcc.y:1360: warning: ignoring return value of ‘Instruction* iSUBROUTINE(parrot_interp_t*, IMC_Unit*, SymReg*)’, declared with attribute warn_unused_result

compilers/imcc/pbc.c:183: warning: ‘int old_blocks(parrot_interp_t*)’ declared ‘static’ but never defined

src/nci_test.c:138: warning: ‘int_cb_D4’ initialised and declared ‘extern’
src/nci_test.c:139: warning: ‘nci_dlvar_char’ initialised and declared ‘extern’
src/nci_test.c:140: warning: ‘nci_dlvar_short’ initialised and declared ‘extern’
src/nci_test.c:141: warning: ‘nci_dlvar_int’ initialised and declared ‘extern’
src/nci_test.c:142: warning: ‘nci_dlvar_long’ initialised and declared ‘extern’
src/nci_test.c:143: warning: ‘nci_dlvar_float’ initialised and declared ‘extern’
src/nci_test.c:144: warning: ‘nci_dlvar_double’ initialised and declared ‘extern’
src/nci_test.c:145: warning: ‘nci_dlvar_cstring’ initialised and declared ‘extern’

./gdbmhash.pmc:255: warning: function call has aggregate value
./gdbmhash.pmc:190: warning: function call has aggregate value
./gdbmhash.pmc:164: warning: function call has aggregate value
./gdbmhash.pmc:166: warning: function call has aggregate value

obscure_ops_switch.c:128: warning: dereferencing type-punned pointer will break strict-aliasing rules

math_ops_switch.c:128: warning: dereferencing type-punned pointer will break strict-aliasing rules