Version 12 (modified by mikehh, 12 years ago)

--

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

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: as of r48016 building on Ubuntu 10.04 amd64/i386 versions (gcc/g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3)

There were some differences in the gcc/g++ (with or without --optimize) but, the the platform (i386/amd64) did not make a difference in the warnings produced.

The following warnings were extracted from the logged output of make world (8 builds in all):

(common):
src/runcore/trace.c: In function ‘trace_key_dump’: (gcc) or src/runcore/trace.c: In function ‘int trace_key_dump(parrot_interp_t*, PMC*)’: (g++)
src/runcore/trace.c:243: warning: comparison between signed and unsigned integer expressions

(without --optimize):
./src/pmc/imageio.pmc: In function ‘visit_todo_list_thaw’: (gcc) or ./src/pmc/imageio.pmc: In function ‘PMC* visit_todo_list_thaw(parrot_interp_t*, PMC*)’: (g++)
./src/pmc/imageio.pmc:266: warning: comparison between signed and unsigned integer expressions

g++ (with or without --optimize)
./src/pmc/imageio.pmc: In function ‘FLOATVAL Parrot_ImageIO_shift_float(parrot_interp_t*, PMC*)’:
./src/pmc/imageio.pmc:613: 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:593: 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:652: warning: cast from type ‘opcode_t**’ to type ‘const opcode_t**’ casts away constness

(common):
compilers/imcc/imclexer.c: In function ‘yy_get_next_buffer’: (gcc) or compilers/imcc/imclexer.c: In function ‘int yy_get_next_buffer(void*)’: (g++)
compilers/imcc/imclexer.c:4209: warning: comparison between signed and unsigned integer expressions

(with --optimize):
compilers/imcc/symreg.c: In function ‘int_overflows’: (gcc) 
compilers/imcc/symreg.c:861: warning: ignoring return value of ‘strtol’, declared with attribute warn_unused_result
compilers/imcc/symreg.c:864: warning: ignoring return value of ‘strtoul’, declared with attribute warn_unused_result

or

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

the next two warnings are gcc (with or without --optimize):
src/glut_nci_thunks.c:7835: warning: no previous prototype for ‘Parrot_glut_nci_loader’

src/extra_nci_thunks.c:6704: warning: no previous prototype for ‘Parrot_lib_extra_nci_thunks_init’

and finally with g++ (with or without --optimize):
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’