mapbox / mapbox/tippecanoe

Compiler warning under gcc 11.3.0 ubuntu-22.04

Open
#957 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.1k
Forks
430
PR merge metrics
No merged PRs in 30d

Description

`make -j` on ubuntu-22.04 (gcc version 11.3.0) includes output:

```
g++ -L/usr/local/lib -g -Wall -Wshadow -Wsign-compare -Wextra -Wunreachable-code -Wuninitialized -Wshadow -O3 -DNDEBUG -std=c++11 -o tippecanoe-enumerate enumerate.o -lsqlite3
tile.cpp: In function ‘bool find_common_edges(std::vector&, int, int, double, int, double)’:
tile.cpp:751:140: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘long int:40’ [-Wformat=]
751 | fprintf(stderr, "Internal error: polygon edge lookup failed for %lld,%lld to %lld,%lld or %lld,%lld to %lld,%lld\n", left[0].x, left[0].y, left[1].x, left[1].y, right[0].x, right[0].y, right[1].x, right[1].y);
| ~~~^
| |
| long long int
tile.cpp:751:145: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘long int:40’ [-Wformat=]
751 | fprintf(stderr, "Internal error: polygon edge lookup failed for %lld,%lld to %lld,%lld or %lld,%lld to %lld,%lld\n", left[0].x, left[0].y, left[1].x, left[1].y, right[0].x, right[0].y, right[1].x, right[1].y);
| ~~~^
| |
| long long int
tile.cpp:751:153: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘long int:40’ [-Wformat=]
751 | fprintf(stderr, "Internal error: polygon edge lookup failed for %lld,%lld to %lld,%lld or %lld,%lld to %lld,%lld\n", left[0].x, left[0].y, left[1].x, left[1].y, right[0].x, right[0].y, right[1].x, right[1].y);
| ~~~^
| |
| long long int
tile.cpp:751:158: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘long int:40’ [-Wformat=]
751 | fprintf(stderr, "Internal error: polygon edge lookup failed for %lld,%lld to %lld,%lld or %lld,%lld to %lld,%lld\n", left[0].x, left[0].y, left[1].x, left[1].y, right[0].x, right[0].y, right[1].x, right[1].y);
| ~~~^
| |
| long long int
tile.cpp:751:166: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 7 has type ‘long int:40’ [-Wformat=]
751 | fprintf(stderr, "Internal error: polygon edge lookup failed for %lld,%lld to %lld,%lld or %lld,%lld to %lld,%lld\n", left[0].x, left[0].y, left[1].x, left[1].y, right[0].x, right[0].y, right[1].x, right[1].y);
| ~~~^
| |
| long long int
tile.cpp:751:171: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 8 has type ‘long int:40’ [-Wformat=]
751 | fprintf(stderr, "Internal error: polygon edge lookup failed for %lld,%lld to %lld,%lld or %lld,%lld to %lld,%lld\n", left[0].x, left[0].y, left[1].x, left[1].y, right[0].x, right[0].y, right[1].x, right[1].y);
| ~~~^
| |
| long long int
tile.cpp:751:179: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 9 has type ‘long int:40’ [-Wformat=]
751 | fprintf(stderr, "Internal error: polygon edge lookup failed for %lld,%lld to %lld,%lld or %lld,%lld to %lld,%lld\n", left[0].x, left[0].y, left[1].x, left[1].y, right[0].x, right[0].y, right[1].x, right[1].y);
| ~~~^
| |
| long long int
tile.cpp:751:184: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 10 has type ‘long int:40’ [-Wformat=]
751 | fprintf(stderr, "Internal error: polygon edge lookup failed for %lld,%lld to %lld,%lld or %lld,%lld to %lld,%lld\n", left[0].x, left[0].y, left[1].x, left[1].y, right[0].x, right[0].y, right[1].x, right[1].y);
| ~~~^
| |
| long long int
geometry.cpp: In function ‘drawvec clean_or_clip_poly(drawvec&, int, int, bool)’:
geometry.cpp:301:65: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘long int:40’ [-Wformat=]
301 | fprintf(f, "[%lld,%lld]", geom[k].x, geom[k].y);
| ~~~^
| |
| long long int
geometry.cpp:301:70: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘long int:40’ [-Wformat=]
301 | fprintf(f, "[%lld,%lld]", geom[k].x, geom[k].y);
| ~~~^
| |
| long long int
geometry.cpp: In function ‘void check_polygon(drawvec&)’:
geometry.cpp:419:68: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘long int:40’ [-Wformat=]
419 | printf("%lld,%lld at %lld not in outer ring (%lld to %lld)\n", geom[k].x, geom[k].y, (long long) k, (long long) outer_start, (long long) (outer_start + outer_len));
| ~~~^
| |
| long long int
geometry.cpp:419:73: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘long int:40’ [-Wformat=]
419 | printf("%lld,%lld at %lld not in outer ring (%lld to %lld)\n", geom[k].x, geom[k].y, (long long) k, (long long) outer_start, (long long) (outer_start + outer_len));
| ~~~^
| |
| long long int
geometry.cpp: In function ‘drawvec reduce_tiny_poly(drawvec&, int, int, bool*, double*)’:
geometry.cpp:586:56: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘long int:40’ [-Wformat=]
586 | fprintf(stderr, "%d/%lld/%lld ", geom[n].op, geom[n].x, geom[n].y);
| ~~~^
| |
| long long int
geometry.cpp:586:61: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘long int:40’ [-Wformat=]
586 | fprintf(stderr, "%d/%lld/%lld ", geom[n].op, geom[n].x, geom[n].y);
| ~~~^
| |
| long long int
g++ -L/usr/local/lib -g -Wall -Wshadow -Wsign-compare -Wextra -Wunreachable-code -Wuninitialized -Wshadow -O3 -DNDEBUG -std=c++11 -o tippecanoe-json-tool jsontool.o jsonpull/jsonpull.o csv.o text.o geojson-loop.o -lm -lz -lsqlite3 -lpthread
```

Contributor guide

Open the contributing guide

Research direction

Start with the format warnings at tile.cpp:751 and geometry.cpp lines 301, 419, and 586. Run `make -j` with GCC on Ubuntu 22.04 to reproduce them, then verify the build completes without these warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.