Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#63767 closed defect (fixed)

tcpick: build failure due to implicit-function-declarations

Reported by: YKPCLN Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: tcpick

Description (last modified by reneeotten (Renee Otten))

First of all Thanks for your helps...

Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_tcpick/tcpick/work/tcpick-0.2.1" && /usr/bin/make -j4 -w all 

I got errors like below when I run that command manually.

	then mv -f ".deps/loop.Tpo" ".deps/loop.Po"; else rm -f ".deps/loop.Tpo"; exit 1; fi
args.c:54:2: error: implicit declaration of function 'color' [-Werror,-Wimplicit-function-declaration]
        color(c_USAGE, stderr, USAGE);
        ^
display.c:91:22: error: implicit declaration of function 'lookup' [-Werror,-Wimplicit-function-declaration]
        client_name=(char *)lookup(conn->client.ip);
                            ^
args.c:105:5: error: implicit declaration of function 'err' [-Werror,-Wimplicit-function-declaration]
                                ERR_FLAV( c );
                                ^
./def.h:48:2: note: expanded from macro 'ERR_FLAV'
 err( "Unrecognized option: %c\n", c );
 ^
args.c:136:5: error: implicit declaration of function 'err' [-Werror,-Wimplicit-function-declaration]
                                ERR_FLAV( c );
                                ^
./def.h:48:2: note: expanded from macro 'ERR_FLAV'
 err( "Unrecognized option: %c\n", c );
 ^
args.c:216:5: error: implicit declaration of function 'suicide' [-Werror,-Wimplicit-function-declaration]
                                suicide( "parse_args", "%s: invalid number of maximum connections",optarg );
                                ^
display.c:91:14: warning: cast to 'char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        client_name=(char *)lookup(conn->client.ip);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display.c:95:6: error: implicit declaration of function 'time_ascii' [-Werror,-Wimplicit-function-declaration]
        if( time_ascii( s_time ) )
            ^
args.c:372:6: error: implicit declaration of function 'err' [-Werror,-Wimplicit-function-declaration]
                                        ERR_FLAV( *optarg );
                                        ^
./def.h:48:2: note: expanded from macro 'ERR_FLAV'
 err( "Unrecognized option: %c\n", c );
 ^
display.c:96:3: error: implicit declaration of function 'color' [-Werror,-Wimplicit-function-declaration]
                color( c_TIME, out,"%-16s ",s_time ); /* FIXME: check */
                ^
args.c:387:3: error: implicit declaration of function 'color' [-Werror,-Wimplicit-function-declaration]
                color( c_USAGE, stdout, PACKAGE_STRING "\n"
                ^
display.c:110:8: error: implicit declaration of function 'getportname' [-Werror,-Wimplicit-function-declaration]
                     getportname(conn->client.port) );
                     ^
6 errors generated.
display.c:110:8: note: did you mean 'gethostname'?
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/unistd.h:626:6: note: 'gethostname' declared here
int      gethostname(char *, size_t);
         ^
display.c:114:14: warning: cast to 'char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        server_name=(char *)lookup(conn->server.ip);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display.c:126:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
display.c:133:17: error: implicit declaration of function 'lookup' [-Werror,-Wimplicit-function-declaration]
        source=(char *)lookup(ippacket->ip_src);
                       ^
display.c:133:9: warning: cast to 'char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        source=(char *)lookup(ippacket->ip_src);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display.c:137:6: error: implicit declaration of function 'time_ascii' [-Werror,-Wimplicit-function-declaration]
        if( time_ascii(s_time) )
            ^
display.c:138:3: error: implicit declaration of function 'color' [-Werror,-Wimplicit-function-declaration]
                color ( c_TIME, out,"%-16s ",s_time );
                ^
display.c:145:37: error: implicit declaration of function 'getportname' [-Werror,-Wimplicit-function-declaration]
        color( c_SERVICE_HEADER, out,"%s ",getportname(tcppacket->source) );
                                           ^
display.c:161:9: warning: cast to 'char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        dest = (char *)lookup( ippacket->ip_dst );
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display.c:175:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
display.c:189:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
display.c:197:9: error: implicit declaration of function 'isascii' [-Werror,-Wimplicit-function-declaration]
                if( ( isascii( CHAR ) && !iscntrl( CHAR ) ) ||
                      ^
display.c:197:29: error: implicitly declaring library function 'iscntrl' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
                if( ( isascii( CHAR ) && !iscntrl( CHAR ) ) ||
                                          ^
display.c:197:29: note: include the header <ctype.h> or explicitly provide a declaration for 'iscntrl'
display.c:201:4: error: implicit declaration of function 'color' [-Werror,-Wimplicit-function-declaration]
                        color(c_NONPRINT, out, "<%2.2x>", CHAR);
                        ^
display.c:208:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
loop.c:45:3: error: implicit declaration of function 'check_expired' [-Werror,-Wimplicit-function-declaration]
                check_expired();display.c
:216                ^:
9: error: implicit declaration of function 'isascii' [-Werror,-Wimplicit-function-declaration]
                if( ( isascii( CHAR ) && !iscntrl( CHAR ) ) ||
                      ^
display.c:220:4: error: implicit declaration of function 'color' [-Werror,-Wimplicit-function-declaration]
                        color( c_NONPRINT, out, "." );
                        ^
display.c:227:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
display.c:241:2: error: implicit declaration of function 'color' [-Werror,-Wimplicit-function-declaration]
        color(c_HEXOFF0, out, "0x%-8.4x", 0);
        ^
make[2]: *** [args.o] Error 1
make[2]: *** Waiting for unfinished jobs....
display.c:247:10: error: implicitly declaring library function 'isgraph' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
                                if ( isgraph( *( buf + pos ) ) )
                                     ^
display.c:247:10: note: include the header <ctype.h> or explicitly provide a declaration for 'isgraph'
loop.c:50:3: error: implicit declaration of function 'fault' [-Werror,-Wimplicit-function-declaration]
                fault( "got_packet", "didn't grab packet" );
                ^
display.c:280:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
display.c:288:2: error: implicit declaration of function 'color' [-Werror,-Wimplicit-function-declaration]
        color(c_HEXOFF0, out, "0x%-8.4x", 0);
        ^
loop.c:98:4: error: implicit declaration of function 'display_header' [-Werror,-Wimplicit-function-declaration]
                        display_header( stdout, ippacket, tcppacket,
                        ^
display.c:300:42: warning: data argument not used by format string [-Wformat-extra-args]
                                fprintf(out, pos % 2 ? "   " : "  ", *( buf + pos ) );
                                                       ~~~~~   ~~~~  ^
display.c:311:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
lookup_query.c:40:27: error: implicit declaration of function '_l_alloc' [-Werror,-Wimplicit-function-declaration]
        node = (struct _l_node *)_l_alloc(ia, (he == NULL) ? inet_ntoa(ia) : he->h_name );
                                 ^
loop.c:101:3: error: implicit declaration of function 'verify' [-Werror,-Wimplicit-function-declaration]
                verify(); /* call the core to manage the packet */
                ^
12 warnings and 16 errors generated.
loop.c:lookup_query.c:40:9: warning: cast to 'struct _l_node *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        node = (struct _l_node *)_l_alloc(ia, (he == NULL) ? inet_ntoa(ia) : he->h_name );
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lookup_query.c:42:2: error: implicit declaration of function '_l_insert' [-Werror,-Wimplicit-function-declaration]
        _l_insert( node );
        ^
106:3: error: implicit declaration of function 'out_flavour' [-Werror,-Wimplicit-function-declaration]
                out_flavour( flags.display_payload,
                ^
loop.c:140:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
lookup_query.c:58:17: error: implicit declaration of function '_l_get' [-Werror,-Wimplicit-function-declaration]
        name = (char *)_l_get(ia);
                       ^
1 warning and 5 errors generated.
lookup_query.c:58:9: warning: cast to 'char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        name = (char *)_l_get(ia);
               ^~~~~~~~~~~~~~~~~~
make[2]: *** [display.o] Error 1
make[2]: *** [loop.o] Error 1
lookup_query.c:83:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                if(ptr=(struct servent *)getservbyport(port, "tcp"))
                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lookup_query.c:83:9: note: place parentheses around the assignment to silence this warning
                if(ptr=(struct servent *)getservbyport(port, "tcp"))
                      ^
                   (                                               )
lookup_query.c:83:9: note: use '==' to turn this assignment into an equality comparison
                if(ptr=(struct servent *)getservbyport(port, "tcp"))

Change History (4)

comment:1 Changed 2 years ago by reneeotten (Renee Otten)

Description: modified (diff)
Keywords: #tcpick removed
Milestone: MacPorts Future

Please attach the main.log to this ticket instead of pasting code (and if you do, use WikiFormatting). The implicit declaration of function errors are well-known and can likely be solved by including the correct headers. Please note that this port has no maintainer, so if you figure out how to solve this please consider submitting a PR.

comment:2 Changed 2 years ago by reneeotten (Renee Otten)

Summary: @tcpick Build Errortcpick: build failure due to implicit-function-declarations

comment:3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In bcfc88fbde89929a6655963782c1ac58c0ce884c/macports-ports (master):

tcpick: Add patches from Debian

Fixes build failures, a CVE, and some other bugs.

Closes: #63767

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

This is ancient software that has not been updated by its developers since January 2005. However, since the Debian maintainers have already developed patches to fix these and other problems, it was easy to add these patches to our port.

Note: See TracTickets for help on using tickets.