Skip to content

Compiler warnings #1069

@jeromekelleher

Description

@jeromekelleher

Collecting some compiler warnings I've hit here:

[17/21] Compiling C object tests.p/tests_tests.c.o
../tests/tests.c: In function ‘test_ancestor_builder_errors’:
../tests/tests.c:465:59: warning: implicit declaration of function ‘fileno’ [-Wimplicit-function-declaration]
  465 |     ret = ancestor_builder_alloc(&ancestor_builder, 2, 1, fileno(mmap_file), 0);
      |                                                           ^~~~~~
../tests/tests.c: In function ‘tsinfer_suite_init’:
../tests/tests.c:1037:10: warning: implicit declaration of function ‘mkstemp’ [-Wimplicit-function-declaration]
 1037 |     fd = mkstemp(_tmp_file_name);
      |          ^~~~~~~

when building the C tests.

Also see this one from the packing test build:

gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -UNDEBUG -Ilib -Ilib/subprojects/tskit -Ilib/subprojects/tskit/tskit -Ilib/subprojects/tskit/subprojects/kastore -I/tmp/build-env-f6cmjig9/lib/python3.12/site-packages/numpy/_core/include -I/tmp/build-env-f6cmjig9/include -I/opt/hostedtoolcache/Python/3.12.12/x64/include/python3.12 -c _tsinfermodule.c -o build/temp.linux-x86_64-cpython-312/_tsinfermodule.o -std=c11
322
gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -UNDEBUG -Ilib -Ilib/subprojects/tskit -Ilib/subprojects/tskit/tskit -Ilib/subprojects/tskit/subprojects/kastore -I/tmp/build-env-f6cmjig9/lib/python3.12/site-packages/numpy/_core/include -I/tmp/build-env-f6cmjig9/include -I/opt/hostedtoolcache/Python/3.12.12/x64/include/python3.12 -c lib/ancestor_builder.c -o build/temp.linux-x86_64-cpython-312/lib/ancestor_builder.o -std=c11
323
lib/ancestor_builder.c: In function ‘ancestor_builder_free_genotype_mmap’:
324
lib/ancestor_builder.c:238:12: warning: ignoring return value of ‘ftruncate’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
325
  238 |     (void) ftruncate(self->mmap_fd, 0);
326
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions