Version 10 (modified by mikehh, 5 years ago)

remaining warnings from g++ build at r45484

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 fix them or update config/auto/warnings.pm to stop complaining about 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

mikehh: remaining warnings at r45484 - Ubuntu 10.04 beta amd64 (g++ with --optimize)

All tests PASS (pre/post-config, make corevm/make coretest, smoke (#33081), fulltest)

from make world:

...
src/ops/core_ops_switch.c: In function ‘op_lib_t* Parrot_DynOp_core_switch_2_2_0(parrot_interp_t*, long int)’:
src/ops/core_ops_switch.c:14711: warning: dereferencing type-punned pointer will break strict-aliasing rules

./src/pmc/callcontext.pmc: In function ‘PMC* Parrot_CallContext_get_pmc(parrot_interp_t*, PMC*)’:
./src/pmc/callcontext.pmc:757: warning: enumeral and non-enumeral type in conditional expression

./src/pmc/imageio.pmc: In function ‘void visit_todo_list_freeze(parrot_interp_t*, PMC*, PMC*)’:
./src/pmc/imageio.pmc:318: warning: enumeral and non-enumeral type in conditional expression
./src/pmc/imageio.pmc: In function ‘FLOATVAL Parrot_ImageIO_shift_float(parrot_interp_t*, PMC*)’:
./src/pmc/imageio.pmc:554: warning: cast from type ‘opcode_t**’ to type ‘const opcode_t**’ casts away constness
./src/pmc/imageio.pmc: In function ‘INTVAL Parrot_ImageIO_shift_integer(parrot_interp_t*, PMC*)’:
./src/pmc/imageio.pmc:535: warning: cast from type ‘opcode_t**’ to type ‘const opcode_t**’ casts away constness
./src/pmc/imageio.pmc: In function ‘STRING* Parrot_ImageIO_shift_string(parrot_interp_t*, PMC*)’:
./src/pmc/imageio.pmc:575: warning: cast from type ‘opcode_t**’ to type ‘const opcode_t**’ casts away constness

compilers/imcc/symreg.c: In function ‘int int_overflows(const SymReg*)’:
compilers/imcc/symreg.c:885: warning: ignoring return value of ‘long int strtol(const char*, char**, int)’, declared with attribute warn_unused_result
compilers/imcc/symreg.c:888: warning: ignoring return value of ‘long unsigned int strtoul(const char*, char**, int)’, declared with attribute warn_unused_result

./gdbmhash.pmc: In function ‘STRING* Parrot_GDBMHash_get_string_keyed(parrot_interp_t*, PMC*, PMC*)’:
./gdbmhash.pmc:250: warning: function call has aggregate value
./gdbmhash.pmc: In function ‘INTVAL Parrot_GDBMHash_get_bool(parrot_interp_t*, PMC*)’:
./gdbmhash.pmc:185: warning: function call has aggregate value
./gdbmhash.pmc: In function ‘INTVAL Parrot_GDBMHash_get_integer(parrot_interp_t*, PMC*)’:
./gdbmhash.pmc:159: warning: function call has aggregate value
./gdbmhash.pmc:161: warning: function call has aggregate value

src/dynoplibs/obscure_ops_switch.c: In function ‘op_lib_t* Parrot_DynOp_obscure_switch_2_2_0(parrot_interp_t*, long int)’:
src/dynoplibs/obscure_ops_switch.c:127: warning: dereferencing type-punned pointer will break strict-aliasing rules

src/dynoplibs/math_ops_switch.c: In function ‘op_lib_t* Parrot_DynOp_math_switch_2_2_0(parrot_interp_t*, long int)’:
src/dynoplibs/math_ops_switch.c:127: warning: dereferencing type-punned pointer will break strict-aliasing rules

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