pcb

Compile warnings on master

Bug #1773652 reported by Chad Parker on 2018-05-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Low
Chad Parker

Bug Description

I'm getting three compile warnings on the current master branch (20180527). We should fix these.

----Warning 1----

../../src/misc.c: In function âParseGroupStringâ:
cc1: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
mv -f .deps/pcb-misc.Tpo .deps/pcb-misc.Po

----Warning 2----

In file included from ../../src/global.h:49:0,
                 from ../../src/undo.c:60:
../../src/undo.c: In function âUndoFlagâ:
../../src/macro.h:119:28: warning: implicit declaration of function âpcb_flag_eqâ [-Wimplicit-function-declaration]
 #define FLAGS_EQUAL(F1,F2) pcb_flag_eq(&(F1), &(F2))
                            ^
../../src/undo.c:632:12: note: in expansion of macro âFLAGS_EQUALâ
       if (!FLAGS_EQUAL (f1, f2))

----Warning 3----

../../src/hid/ipcd356/ipcd356.c: In function âIPCD356_SanityCheckâ:
../../src/hid/ipcd356/ipcd356.c:655:37: warning: comparison between pointer and zero character constant [-Wpointer-compare]
     if (element->Name[1].TextString == '\0')
                                     ^~
../../src/hid/ipcd356/ipcd356.c:655:9: note: did you mean to dereference the pointer?
     if (element->Name[1].TextString == '\0')
         ^
../../src/hid/ipcd356/ipcd356.c: In function âIPCD356_WriteAliasesâ:
../../src/hid/ipcd356/ipcd356.c:596:57: warning: â%-5.5dâ directive writing between 5 and 10 bytes into a region of size 6 [-Wformat-overflow=]
           sprintf (aliaslist->Alias[index].NName, "NNAME%-5.5d", index);
                                                         ^~~~~~
../../src/hid/ipcd356/ipcd356.c:596:51: note: directive argument in the range [1, 2147483647]
           sprintf (aliaslist->Alias[index].NName, "NNAME%-5.5d", index);
                                                   ^~~~~~~~~~~~~
../../src/hid/ipcd356/ipcd356.c:596:11: note: âsprintfâ output between 11 and 16 bytes into a destination of size 11
           sprintf (aliaslist->Alias[index].NName, "NNAME%-5.5d", index);

Chad Parker (parker-charles) wrote :

gcc version 7.3

tags: added: build-system
Changed in pcb:
importance: Undecided → Low
status: New → In Progress
Chad Parker (parker-charles) wrote :

I've fixed two of these in LP1773652.

Re: the first on in misc.c... the source of this isn't obvious. I think it's being produced by something that's being optimized because if I remove the -O2 flag from the compiler command the warning goes away. Presently, this is beyond me.

Changed in pcb:
assignee: nobody → Chad Parker (parker-charles)
Changed in pcb:
milestone: none → pcb-4.2.0
Changed in pcb:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints