pcb

Compiler warnings in gcc-9.1.0

Bug #1830546 reported by Chad Parker on 2019-05-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Low
Unassigned

Bug Description

Compiler warnings thrown building master with gcc 9.1.0.

../../src/draw.c: In function ‘hid_expose_callback’:
../../src/draw.c:708:32: warning: ‘%02d’ directive writing between 2 and 10 bytes into a region of size 9 [-Wformat-overflow=]
  708 | sprintf (s, "plated-drill_%02d-%02d", g_from+1, g_to+1);
      | ^~~~
../../src/draw.c:708:18: note: directive argument in the range [1, 2147483646]
  708 | sprintf (s, "plated-drill_%02d-%02d", g_from+1, g_to+1);
      | ^~~~~~~~~~~~~~~~~~~~~~~~
../../src/draw.c:708:18: note: directive argument in the range [-2147483647, 2147483647]
../../src/draw.c:708:6: note: ‘sprintf’ output between 19 and 36 bytes into a destination of size 22
  708 | sprintf (s, "plated-drill_%02d-%02d", g_from+1, g_to+1);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/draw.c:715:34: warning: ‘%02d’ directive writing between 2 and 10 bytes into a region of size 7 [-Wformat-overflow=]
  715 | sprintf (s, "unplated-drill_%02d-%02d", g_from+1, g_to+1);
      | ^~~~
../../src/draw.c:715:18: note: directive argument in the range [1, 2147483646]
  715 | sprintf (s, "unplated-drill_%02d-%02d", g_from+1, g_to+1);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/draw.c:715:18: note: directive argument in the range [-2147483647, 2147483647]
../../src/draw.c:715:6: note: ‘sprintf’ output between 21 and 38 bytes into a destination of size 22
  715 | sprintf (s, "unplated-drill_%02d-%02d", g_from+1, g_to+1);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mv -f .deps/pcb-draw.Tpo .deps/pcb-draw.Po

../../src/misc.c: In function ‘UniqueElementName’:
../../src/misc.c:1940:21: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
 1940 | sprintf (temp, "%s%d", start, num);
      | ^~
../../src/misc.c:1940:18: note: directive argument in the range [-2147483647, 2147483647]
 1940 | sprintf (temp, "%s%d", start, num);
      | ^~~~~~
../../src/misc.c:1940:3: note: ‘sprintf’ output between 2 and 267 bytes into a destination of size 256
 1940 | sprintf (temp, "%s%d", start, num);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mv -f .deps/pcb-misc.Tpo .deps/pcb-misc.Po

Changed in pcb:
milestone: none → future-bug-fix-release
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers