pcb

Compile warnings when DEBUG symbol is defined

Bug #1659061 reported by Chad Parker on 2017-01-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Medium
Unassigned

Bug Description

When the DEBUG symbol is defined, there are a whole bunch of compile warnings. See below:

action.c: In function 'ActionElementList':
action.c:7189:7: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
       int er, pr, i;
       ^~~
action.c: In function 'tempfile_unlink':
action.c:7492:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   int e, rc2 = 0;
   ^~~

copy.c: In function 'CopyElement':
copy.c:295:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   ElementType *element = CopyElementLowLevel (PCB->Data, Element,
   ^~~~~~~~~~~

edif.y:3916:8: warning: return type defaults to 'int' [-Wimplicit-int]
 static Stack(char * str, int typ)
        ^~~~~
edif.y:3932:8: warning: return type defaults to 'int' [-Wimplicit-int]
 static DumpStack()
        ^~~~~~~~~
edif.y: In function 'DumpStack':
edif.y:3950:7: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
       if (cxt = FindContext(TokenType[(TSP + i) & TS_MASK]))
       ^~
edif.y:3952:7: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
       else if (tok = FindToken(TokenType[(TSP + i) & TS_MASK]))
       ^~~~
edif.y: In function 'Stack':
edif.y:3926:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
edif.y: In function 'DumpStack':
edif.y:3968:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Chad Parker (parker-charles) wrote :

I pushed a branch to fix these, home/cparker/LP16559061.

This branch is a follow on to home/cparker/LP1659045 and the related bug https://bugs.launchpad.net/pcb/+bug/1659045.

Changed in pcb:
status: New → In Progress
Changed in pcb:
milestone: none → pcb-4.0.1
importance: Undecided → Medium
Bert Timmerman (bert-timmerman) wrote :

Hi Chad,

I pushed your commits to master.

Thanks and kind regards,

Bert Timmerman.

Changed in pcb:
status: In Progress → Fix Committed
Changed in pcb:
milestone: pcb-4.0.1 → pcb-4.1.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints