rubund / graywolf

Other
107 stars 36 forks source link

Please fix obviosuly incorrect C syntax #40

Open yurivict opened 4 years ago

yurivict commented 4 years ago

clang-8 rightfully complains:

/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:502:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if( reply = XGetDefault( dpyS, GRAPHICS, "bw" )){
            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:502:12: note: place parentheses around the assignment to silence this warning
        if( reply = XGetDefault( dpyS, GRAPHICS, "bw" )){
                  ^
            (                                          )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:502:12: note: use '==' to turn this assignment into an equality comparison
        if( reply = XGetDefault( dpyS, GRAPHICS, "bw" )){
                  ^
                  ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:513:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if(font = XGetDefault( dpyS, GRAPHICS, "font" )){
       ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:513:13: note: place parentheses around the assignment to silence this warning
    if(font = XGetDefault( dpyS, GRAPHICS, "font" )){
            ^
       (                                           )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:513:13: note: use '==' to turn this assignment into an equality comparison
    if(font = XGetDefault( dpyS, GRAPHICS, "font" )){
            ^
            ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:527:15: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( reply = XGetDefault( dpyS, GRAPHICS, "stipple" )){
        ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:527:15: note: place parentheses around the assignment to silence this warning
    if( reply = XGetDefault( dpyS, GRAPHICS, "stipple" )){
              ^
        (                                               )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:527:15: note: use '==' to turn this assignment into an equality comparison
    if( reply = XGetDefault( dpyS, GRAPHICS, "stipple" )){
              ^
              ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:533:15: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( reply = XGetDefault( dpyS, GRAPHICS, "rectangle_fill" )){
        ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:533:15: note: place parentheses around the assignment to silence this warning
    if( reply = XGetDefault( dpyS, GRAPHICS, "rectangle_fill" )){
              ^
        (                                                      )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:533:15: note: use '==' to turn this assignment into an equality comparison
    if( reply = XGetDefault( dpyS, GRAPHICS, "rectangle_fill" )){
              ^
              ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:539:15: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( reply = XGetDefault( dpyS, GRAPHICS, "arbitrary_fill" )){
        ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:539:15: note: place parentheses around the assignment to silence this warning
    if( reply = XGetDefault( dpyS, GRAPHICS, "arbitrary_fill" )){
              ^
        (                                                      )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:539:15: note: use '==' to turn this assignment into an equality comparison
    if( reply = XGetDefault( dpyS, GRAPHICS, "arbitrary_fill" )){
              ^
              ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:545:15: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( reply = XGetDefault( dpyS, GRAPHICS, "reverse" )){
        ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:545:15: note: place parentheses around the assignment to silence this warning
    if( reply = XGetDefault( dpyS, GRAPHICS, "reverse" )){
              ^
        (                                               )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:545:15: note: use '==' to turn this assignment into an equality comparison
    if( reply = XGetDefault( dpyS, GRAPHICS, "reverse" )){
              ^
              ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:552:15: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( reply = XGetDefault( dpyS, GRAPHICS, "wait_time" )){
        ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:552:15: note: place parentheses around the assignment to silence this warning
    if( reply = XGetDefault( dpyS, GRAPHICS, "wait_time" )){
              ^
        (                                                 )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:552:15: note: use '==' to turn this assignment into an equality comparison
    if( reply = XGetDefault( dpyS, GRAPHICS, "wait_time" )){
              ^
              ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:560:16: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( winstr = XGetDefault( dpyS, GRAPHICS, "geometry" )){
        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:560:16: note: place parentheses around the assignment to silence this warning
    if( winstr = XGetDefault( dpyS, GRAPHICS, "geometry" )){
               ^
        (                                                 )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:560:16: note: use '==' to turn this assignment into an equality comparison
    if( winstr = XGetDefault( dpyS, GRAPHICS, "geometry" )){
               ^
               ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:931:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end set_clip_window() */ 
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:949:43: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    sprintf( YmsgG, "new center - %d,%d", x1, y1 ) ;
                                  ~~      ^~
                                  %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:949:47: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    sprintf( YmsgG, "new center - %d,%d", x1, y1 ) ;
                                     ~~       ^~
                                     %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1189:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end initcolor */
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1198:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            sprintf( YmsgG, "Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1201:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            fprintf( stderr,"Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1238:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            sprintf( YmsgG, "Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1241:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            fprintf( stderr,"Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1243:2: error: non-void function 'drawDLine' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1245:2: error: non-void function 'drawDLine' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1255:6: error: non-void function 'drawDLine' should return a value [-Wreturn-type]
            return ;
            ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1295:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            sprintf( YmsgG, "Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1298:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            fprintf( stderr,"Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1300:2: error: non-void function 'drawDRect' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1302:2: error: non-void function 'drawDRect' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1307:6: error: non-void function 'drawDRect' should return a value [-Wreturn-type]
            return ;
            ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1432:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            sprintf( YmsgG, "Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1435:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            fprintf( stderr,"Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1437:2: error: non-void function 'drawDArb' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1439:2: error: non-void function 'drawDArb' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1464:6: error: non-void function 'drawDArb' should return a value [-Wreturn-type]
            return ;
            ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1613:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if( press = XCheckTypedWindowEvent( dpyS,drawS,
            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1613:12: note: place parentheses around the assignment to silence this warning
        if( press = XCheckTypedWindowEvent( dpyS,drawS,
                  ^
            (
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1613:12: note: use '==' to turn this assignment into an equality comparison
        if( press = XCheckTypedWindowEvent( dpyS,drawS,
                  ^
                  ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1983:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            sprintf( YmsgG, "Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:1986:57: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            fprintf( stderr,"Color number:%d is out of range", color ) ;
                                          ~~                   ^~~~~
                                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2067:52: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    sprintf( filename, "%s/cell.bin.%d", dirNameS, frameCountS ) ;
                                    ~~             ^~~~~~~~~~~
                                    %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2072:51: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    sprintf( filename, "%s/net.bin.%d", dirNameS, frameCountS ) ;
                                   ~~             ^~~~~~~~~~~
                                   %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2077:52: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    sprintf( filename, "%s/symb.bin.%d", dirNameS, frameCountS ) ;
                                    ~~             ^~~~~~~~~~~
                                    %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2109:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if( excess = numCharS % 4 ){
            ~~~~~~~^~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2109:13: note: place parentheses around the assignment to silence this warning
        if( excess = numCharS % 4 ){
                   ^
            (                    )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2109:13: note: use '==' to turn this assignment into an equality comparison
        if( excess = numCharS % 4 ){
                   ^
                   ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2145:50: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
            sprintf( fileName,"%s/cell.bin.%d",dirNameS,frameCountS ) ;
                                           ~~           ^~~~~~~~~~~
                                           %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2170:2: error: non-void function 'drawWLine' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2177:6: error: non-void function 'drawWLine' should return a value [-Wreturn-type]
            return ;
            ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2227:2: error: non-void function 'drawWRect' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2234:6: error: non-void function 'drawWRect' should return a value [-Wreturn-type]
            return ;
            ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2278:2: error: non-void function 'drawWArb' should return a value [-Wreturn-type]
        return ;
        ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2285:6: error: non-void function 'drawWArb' should return a value [-Wreturn-type]
            return ;
            ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2292:20: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    while( bustptr = Ybuster() ){
           ~~~~~~~~^~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2292:20: note: place parentheses around the assignment to silence this warning
    while( bustptr = Ybuster() ){
                   ^
           (                  )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/draw.c:2292:20: note: use '==' to turn this assignment into an equality comparison
    while( bustptr = Ybuster() ){
                   ^
                   ==
29 warnings and 15 errors generated.
[6/219] /usr/bin/cc -Dycadgraywolf_EXPORTS -I/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/include -Iinclude -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -DSIZEOF_VOID_P=64 -Wno-implicit-function-declaration -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT src/Ylib/CMakeFiles/ycadgraywolf.dir/file.c.o -MF src/Ylib/CMakeFiles/ycadgraywolf.dir/file.c.o.d -o src/Ylib/CMakeFiles/ycadgraywolf.dir/file.c.o   -c /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/file.c
In file included from /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/file.c:136:
/usr/include/sys/dir.h:41:2: warning: "The information in this file should be obtained from <dirent.h>" [-W#warnings]
#warning "The information in this file should be obtained from <dirent.h>"
 ^
/usr/include/sys/dir.h:42:2: warning: "and is provided solely (and temporarily) for backward compatibility." [-W#warnings]
#warning "and is provided solely (and temporarily) for backward compatibility."
 ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/file.c:145:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if( dp = opendir(pathname) ){
            ~~~^~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/file.c:145:9: note: place parentheses around the assignment to silence this warning
        if( dp = opendir(pathname) ){
               ^
            (                     )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/file.c:145:9: note: use '==' to turn this assignment into an equality comparison
        if( dp = opendir(pathname) ){
               ^
               ==
3 warnings generated.
[7/219] /usr/bin/cc -Dycadgraywolf_EXPORTS -I/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/include -Iinclude -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -DSIZEOF_VOID_P=64 -Wno-implicit-function-declaration -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT src/Ylib/CMakeFiles/ycadgraywolf.dir/edcolors.c.o -MF src/Ylib/CMakeFiles/ycadgraywolf.dir/edcolors.c.o.d -o src/Ylib/CMakeFiles/ycadgraywolf.dir/edcolors.c.o   -c /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/edcolors.c
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/edcolors.c:135:16: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( answer = TWdialog( fieldS, "colors", NULL ) ){
        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/edcolors.c:135:16: note: place parentheses around the assignment to silence this warning
    if( answer = TWdialog( fieldS, "colors", NULL ) ){
               ^
        (                                          )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/edcolors.c:135:16: note: use '==' to turn this assignment into an equality comparison
    if( answer = TWdialog( fieldS, "colors", NULL ) ){
               ^
               ==
1 warning generated.
[8/219] /usr/bin/cc -Dycadgraywolf_EXPORTS -I/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/include -Iinclude -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -DSIZEOF_VOID_P=64 -Wno-implicit-function-declaration -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT src/Ylib/CMakeFiles/ycadgraywolf.dir/dset.c.o -MF src/Ylib/CMakeFiles/ycadgraywolf.dir/dset.c.o.d -o src/Ylib/CMakeFiles/ycadgraywolf.dir/dset.c.o   -c /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:100:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end dset_free_element() */
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:211:11: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  if( ptr = (ELEMENTPTR) Yrbtree_search( dset->dtree, &dummy )){
      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:211:11: note: place parentheses around the assignment to silence this warning
  if( ptr = (ELEMENTPTR) Yrbtree_search( dset->dtree, &dummy )){
          ^
      (                                                       )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:211:11: note: use '==' to turn this assignment into an equality comparison
  if( ptr = (ELEMENTPTR) Yrbtree_search( dset->dtree, &dummy )){
          ^
          ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:456:11: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  if( ptr = (ELEMENTPTR) Yrbtree_search( dset->dtree, &dummy )){
      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:456:11: note: place parentheses around the assignment to silence this warning
  if( ptr = (ELEMENTPTR) Yrbtree_search( dset->dtree, &dummy )){
          ^
      (                                                       )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:456:11: note: use '==' to turn this assignment into an equality comparison
  if( ptr = (ELEMENTPTR) Yrbtree_search( dset->dtree, &dummy )){
          ^
          ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:476:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end Ydset_free */
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:502:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end Ydset_empty */
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:547:11: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  if (ptr = dset_find_set(dset, data) ) {
      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:547:11: note: place parentheses around the assignment to silence this warning
  if (ptr = dset_find_set(dset, data) ) {
          ^
      (                              )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:547:11: note: use '==' to turn this assignment into an equality comparison
  if (ptr = dset_find_set(dset, data) ) {
          ^
          ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:564:11: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  if( ptr = find( dset, data )){
      ~~~~^~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:564:11: note: place parentheses around the assignment to silence this warning
  if( ptr = find( dset, data )){
          ^
      (                       )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:564:11: note: use '==' to turn this assignment into an equality comparison
  if( ptr = find( dset, data )){
          ^
          ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:590:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( ptr = (ELEMENTPTR)Yrbtree_search( dset->dtree, &dummy )){
        ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:590:13: note: place parentheses around the assignment to silence this warning
    if( ptr = (ELEMENTPTR)Yrbtree_search( dset->dtree, &dummy )){
            ^
        (                                                      )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:590:13: note: use '==' to turn this assignment into an equality comparison
    if( ptr = (ELEMENTPTR)Yrbtree_search( dset->dtree, &dummy )){
            ^
            ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:639:45: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    fprintf(stderr,"sizeIn:%d sizeOut:%d\n",sizeIn,sizeOut);
                           ~~               ^~~~~~
                           %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:639:52: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    fprintf(stderr,"sizeIn:%d sizeOut:%d\n",sizeIn,sizeOut);
                                      ~~           ^~~~~~~
                                      %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:671:44: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
  fprintf(stderr,"set contains %d items\n",Yrbtree_size(dset->dtree));
                               ~~          ^~~~~~~~~~~~~~~~~~~~~~~~~
                               %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:677:55: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
      fprintf(stderr,"\n%d items in set #%d [parent ",parent->size,count++);
                        ~~                            ^~~~~~~~~~~~
                        %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:677:68: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
      fprintf(stderr,"\n%d items in set #%d [parent ",parent->size,count++);
                                         ~~                        ^~~~~~~
                                         %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:681:24: warning: format specifies type 'long' but the argument has type 'ELEMENTPTR' (aka 'struct dset_element *') [-Wformat]
        fprintf(stderr,"%ld ",parent);
                        ~~~   ^~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dset.c:688:29: warning: format specifies type 'long' but the argument has type 'VOIDPTR' (aka 'long *') [-Wformat]
      fprintf(stderr,"%ld ",ptr);
                      ~~~   ^~~
15 warnings generated.
[9/219] /usr/bin/cc -Dycadgraywolf_EXPORTS -I/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/include -Iinclude -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -DSIZEOF_VOID_P=64 -Wno-implicit-function-declaration -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT src/Ylib/CMakeFiles/ycadgraywolf.dir/getftime.c.o -MF src/Ylib/CMakeFiles/ycadgraywolf.dir/getftime.c.o.d -o src/Ylib/CMakeFiles/ycadgraywolf.dir/getftime.c.o   -c /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/getftime.c
[10/219] /usr/bin/cc -Dycadgraywolf_EXPORTS -I/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/include -Iinclude -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -DSIZEOF_VOID_P=64 -Wno-implicit-function-declaration -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT src/Ylib/CMakeFiles/ycadgraywolf.dir/graph.c.o -MF src/Ylib/CMakeFiles/ycadgraywolf.dir/graph.c.o.d -o src/Ylib/CMakeFiles/ycadgraywolf.dir/graph.c.o   -c /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c
FAILED: src/Ylib/CMakeFiles/ycadgraywolf.dir/graph.c.o 
/usr/bin/cc -Dycadgraywolf_EXPORTS -I/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/include -Iinclude -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -DSIZEOF_VOID_P=64 -Wno-implicit-function-declaration -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT src/Ylib/CMakeFiles/ycadgraywolf.dir/graph.c.o -MF src/Ylib/CMakeFiles/ycadgraywolf.dir/graph.c.o.d -o src/Ylib/CMakeFiles/ycadgraywolf.dir/graph.c.o   -c /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:262:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:281:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:304:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:368:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:400:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:501:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:510:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:610:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:619:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:634:16: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  if ( nodePtr = (YNODEPTR)Yrbtree_search (graph->nodeTree,&nodeDummy)  ) {
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:634:16: note: place parentheses around the assignment to silence this warning
  if ( nodePtr = (YNODEPTR)Yrbtree_search (graph->nodeTree,&nodeDummy)  ) {
               ^
       (                                                              )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:634:16: note: use '==' to turn this assignment into an equality comparison
  if ( nodePtr = (YNODEPTR)Yrbtree_search (graph->nodeTree,&nodeDummy)  ) {
               ^
               ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:722:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:774:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:894:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:903:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1001:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1010:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1022:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1329:5: error: non-void function 'Ygraph_bfs' should return a value [-Wreturn-type]
    return;
    ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1354:20: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  while ( nextNode = (YNODEPTR) Yheap_delete_min(heap) ) {
          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1354:20: note: place parentheses around the assignment to silence this warning
  while ( nextNode = (YNODEPTR) Yheap_delete_min(heap) ) {
                   ^
          (                                           )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1354:20: note: use '==' to turn this assignment into an equality comparison
  while ( nextNode = (YNODEPTR) Yheap_delete_min(heap) ) {
                   ^
                   ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1572:24: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        while (adjEdge = (YEDGEPTR) Ydeck_pop(swapDeck)) {
               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1572:24: note: place parentheses around the assignment to silence this warning
        while (adjEdge = (YEDGEPTR) Ydeck_pop(swapDeck)) {
                       ^
               (                                       )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1572:24: note: use '==' to turn this assignment into an equality comparison
        while (adjEdge = (YEDGEPTR) Ydeck_pop(swapDeck)) {
                       ^
                       ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1672:20: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  while ( nextEdge = (YEDGEPTR)Yheap_delete_min(heap)) {
          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1672:20: note: place parentheses around the assignment to silence this warning
  while ( nextEdge = (YEDGEPTR)Yheap_delete_min(heap)) {
                   ^
          (                                          )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1672:20: note: use '==' to turn this assignment into an equality comparison
  while ( nextEdge = (YEDGEPTR)Yheap_delete_min(heap)) {
                   ^
                   ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1730:20: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  while ( nextEdge = (YEDGEPTR)Yheap_delete_min(heap)) {
          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1730:20: note: place parentheses around the assignment to silence this warning
  while ( nextEdge = (YEDGEPTR)Yheap_delete_min(heap)) {
                   ^
          (                                          )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1730:20: note: use '==' to turn this assignment into an equality comparison
  while ( nextEdge = (YEDGEPTR)Yheap_delete_min(heap)) {
                   ^
                   ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1809:20: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  while ( nextNode = (YNODEPTR)Yheap_delete_min(heap)) {
          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1809:20: note: place parentheses around the assignment to silence this warning
  while ( nextNode = (YNODEPTR)Yheap_delete_min(heap)) {
                   ^
          (                                          )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1809:20: note: use '==' to turn this assignment into an equality comparison
  while ( nextNode = (YNODEPTR)Yheap_delete_min(heap)) {
                   ^
                   ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:1847:29: warning: '/*' within block comment [-Wcomment]
          /* Ygraph_draw(graph);   /* debug */
                                   ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2298:20: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
  while ( nextNode = (YNODEPTR) Yheap_delete_min(heap) ) {
          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2298:20: note: place parentheses around the assignment to silence this warning
  while ( nextNode = (YNODEPTR) Yheap_delete_min(heap) ) {
                   ^
          (                                           )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2298:20: note: use '==' to turn this assignment into an equality comparison
  while ( nextNode = (YNODEPTR) Yheap_delete_min(heap) ) {
                   ^
                   ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2493:19: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
     while ( edge = (YEDGEPTR) Ydeck_pop( pathDeck ) )  {
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2493:19: note: place parentheses around the assignment to silence this warning
     while ( edge = (YEDGEPTR) Ydeck_pop( pathDeck ) )  {
                  ^
             (                                      )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2493:19: note: use '==' to turn this assignment into an equality comparison
     while ( edge = (YEDGEPTR) Ydeck_pop( pathDeck ) )  {
                  ^
                  ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2558:5: error: non-void function 'Ygraph_steinerImprove' should return a value [-Wreturn-type]
    return;
    ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2563:5: error: non-void function 'Ygraph_steinerImprove' should return a value [-Wreturn-type]
    return;
    ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2569:5: error: non-void function 'Ygraph_steinerImprove' should return a value [-Wreturn-type]
    return;
    ^
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2612:28: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        for ( count = 1; nextEdge = (YEDGEPTR) Ygraph_listAdjEdges(node,count);
                         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2612:28: note: place parentheses around the assignment to silence this warning
        for ( count = 1; nextEdge = (YEDGEPTR) Ygraph_listAdjEdges(node,count);
                                  ^
                         (                                                    )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2612:28: note: use '==' to turn this assignment into an equality comparison
        for ( count = 1; nextEdge = (YEDGEPTR) Ygraph_listAdjEdges(node,count);
                                  ^
                                  ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2690:21: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
      while ( edge2 = (YEDGEPTR) Ydeck_pop(connectDeck) ) {
              ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2690:21: note: place parentheses around the assignment to silence this warning
      while ( edge2 = (YEDGEPTR) Ydeck_pop(connectDeck) ) {
                    ^
              (                                        )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:2690:21: note: use '==' to turn this assignment into an equality comparison
      while ( edge2 = (YEDGEPTR) Ydeck_pop(connectDeck) ) {
                    ^
                    ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:3026:42: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
  fprintf(stderr,"graph has %d edges \n",Ygraph_edgeCount(graph));
                            ~~           ^~~~~~~~~~~~~~~~~~~~~~~
                            %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/graph.c:3041:42: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
  fprintf(stderr,"graph has %d nodes \n",Ygraph_nodeCount(graph));
                            ~~           ^~~~~~~~~~~~~~~~~~~~~~~
                            %ld
29 warnings and 4 errors generated.
[11/219] /usr/bin/cc -Dycadgraywolf_EXPORTS -I/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/include -Iinclude -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -DSIZEOF_VOID_P=64 -Wno-implicit-function-declaration -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT src/Ylib/CMakeFiles/ycadgraywolf.dir/dialog.c.o -MF src/Ylib/CMakeFiles/ycadgraywolf.dir/dialog.c.o.d -o src/Ylib/CMakeFiles/ycadgraywolf.dir/dialog.c.o   -c /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:217:16: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if( winstr = XGetDefault( dpyS, GRAPHICS, resource )){
        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:217:16: note: place parentheses around the assignment to silence this warning
    if( winstr = XGetDefault( dpyS, GRAPHICS, resource )){
               ^
        (                                               )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:217:16: note: use '==' to turn this assignment into an equality comparison
    if( winstr = XGetDefault( dpyS, GRAPHICS, resource )){
               ^
               ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:241:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    if(font = XGetDefault( dpyS, GRAPHICS, resource )){
       ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:241:13: note: place parentheses around the assignment to silence this warning
    if(font = XGetDefault( dpyS, GRAPHICS, resource )){
            ^
       (                                             )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:241:13: note: use '==' to turn this assignment into an equality comparison
    if(font = XGetDefault( dpyS, GRAPHICS, resource )){
            ^
            ==
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:542:25: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        } else if( font_change = REVERT_FONT ){
                   ~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:542:25: note: place parentheses around the assignment to silence this warning
        } else if( font_change = REVERT_FONT ){
                               ^
                   (                        )
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/dialog.c:542:25: note: use '==' to turn this assignment into an equality comparison
        } else if( font_change = REVERT_FONT ){
                               ^
                               ==
3 warnings generated.
[12/219] /usr/bin/cc -Dycadgraywolf_EXPORTS -I/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/include -Iinclude -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -DSIZEOF_VOID_P=64 -Wno-implicit-function-declaration -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing -fPIC -MD -MT src/Ylib/CMakeFiles/ycadgraywolf.dir/assign.c.o -MF src/Ylib/CMakeFiles/ycadgraywolf.dir/assign.c.o.d -o src/Ylib/CMakeFiles/ycadgraywolf.dir/assign.c.o   -c /usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/assign.c
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/assign.c:500:44: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    fprintf(stderr,"sum = %d, max = %d\n", sum, max );
                          ~~               ^~~
                          %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/assign.c:500:49: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
    fprintf(stderr,"sum = %d, max = %d\n", sum, max );
                                    ~~          ^~~
                                    %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/assign.c:502:29: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
        fprintf(stderr,"%d  %d\n", j, capS[j]);
                        ~~         ^
                        %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/assign.c:502:32: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
        fprintf(stderr,"%d  %d\n", j, capS[j]);
                            ~~        ^~~~~~~
                            %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/assign.c:507:28: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
                fprintf( stderr, "[%d]", cost_matrix[i][j]);
                                   ~~    ^~~~~~~~~~~~~~~~~
                                   %ld
/usr/ports/cad/graywolf/work/graywolf-0.1.6-3-g6c5e24f/src/Ylib/assign.c:509:28: warning: format specifies type 'int' but the argument has type 'INT' (aka 'long') [-Wformat]
                fprintf( stderr, " %d ", cost_matrix[i][j]);
                                   ~~    ^~~~~~~~~~~~~~~~~
                                   %ld
RTimothyEdwards commented 4 years ago

Or you might say "clang wrongfully complains" because "if(x = y)" is perfectly valid C syntax (set x to the value of y and then execute the conditional based on whether x is 0 or 1).

yurivict commented 4 years ago

This is a safeguard against a very common error when if (a = b) is meant to be a comparison. This catches a lot of programming errors, and this is a very infrequent use pattern. If your project uses this pattern, in order to silence this warning you should add -Wno-parentheses.

StefanBruens commented 4 years ago

The if (a = b) case can be silenced by using if ((a = b)), the second pair of parentheses tells the compiler "yes, this is an assignment, evaluate the value as a boolean expression). But it is much more readable to do an explicit assignment, especially when used in a for loop, e.g. for ( count = 1; nextEdge = (YEDGEPTR) Ygraph_listAdjEdges(node,count);

yurivict commented 3 years ago

@StefanBruens What about errors?

Currently clang fails to compile graywolf.

Could you please make sure that clang compiles it?

Thanks. Yuri

patrickschulz commented 3 years ago

I'm not sure what the further action here is. Compiling with -Wall creates tons of warnings, some of which are not just nitpicking. IMHO, warnings about assignments in if-statements should always be handled by either fixing it or (if intended) silenced by double parentheses. Also there are a lot of wrong printf formatting directives (wrong integer type, for instance). I'm happy starting to fix these, I'd just like to know if there is any intention on fixing these/accepting appropriate pull requests. I would be happy to hear more in this matter :)