Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undeclared functions in libmetrics/darwin/metrics.c #370

Open
Schamschula opened this issue Feb 22, 2024 · 0 comments
Open

undeclared functions in libmetrics/darwin/metrics.c #370

Schamschula opened this issue Feb 22, 2024 · 0 comments

Comments

@Schamschula
Copy link

As I was attempting to update ganglia-web to version 3.7.6 under MacPorts, I had to first install ganglia. It had been a while. In the meantime clang under macOS has made undeclared functions errors.

Hence the build fails:

:info:build make[3]: Entering directory `/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_net_ganglia/ganglia/work/ganglia-3.7.2/libmetrics'
:info:build Making all in darwin
:info:build make[4]: Entering directory `/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_net_ganglia/ganglia/work/ganglia-3.7.2/libmetrics/darwin'
:info:build /bin/sh ../libtool --tag=CC   --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I..   -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -I.. -I../../lib -I../../include -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64 -Wall -MT metrics.lo -MD -MP -MF .deps/metrics.Tpo -c -o metrics.lo metrics.c
:info:build libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -I.. -I../../lib -I../../include -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64 -Wall -MT metrics.lo -MD -MP -MF .deps/metrics.Tpo -c metrics.c  -fno-common -DPIC -o .libs/metrics.o
:info:build metrics.c:193:10: warning: variable 'prefix' set but not used [-Wunused-but-set-variable]
:info:build    char *prefix, buf[1024];
:info:build          ^
:info:build metrics.c:214:10: warning: variable 'prefix' set but not used [-Wunused-but-set-variable]
:info:build    char *prefix, buf[1024];
:info:build          ^
:info:build metrics.c:235:10: warning: variable 'prefix' set but not used [-Wunused-but-set-variable]
:info:build    char *prefix, buf[1024];
:info:build          ^
:info:build metrics.c:266:13: warning: variable 'val' is uninitialized when used here [-Wuninitialized]
:info:build      return val;
:info:build             ^~~
:info:build metrics.c:259:4: note: variable 'val' is declared here
:info:build    g_val_t val;
:info:build    ^
:info:build metrics.c:302:13: warning: variable 'val' is uninitialized when used here [-Wuninitialized]
:info:build      return val;
:info:build             ^~~
:info:build metrics.c:295:4: note: variable 'val' is declared here
:info:build    g_val_t val;
:info:build    ^
:info:build metrics.c:338:13: warning: variable 'val' is uninitialized when used here [-Wuninitialized]
:info:build      return val;
:info:build             ^~~
:info:build metrics.c:331:4: note: variable 'val' is declared here
:info:build    g_val_t val;
:info:build    ^
:info:build metrics.c:374:13: warning: variable 'val' is uninitialized when used here [-Wuninitialized]
:info:build      return val;
:info:build             ^~~
:info:build metrics.c:367:4: note: variable 'val' is declared here
:info:build    g_val_t val;
:info:build    ^
:info:build metrics.c:410:13: warning: variable 'val' is uninitialized when used here [-Wuninitialized]
:info:build      return val;
:info:build             ^~~
:info:build metrics.c:403:4: note: variable 'val' is declared here
:info:build    g_val_t val;
:info:build    ^
:info:build metrics.c:672:12: error: call to undeclared function 'host_processor_sets'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build    error = host_processor_sets(ganglia_port, &psets, &pcnt);
:info:build            ^
:info:build metrics.c:672:12: note: did you mean 'host_processor_info'?
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/mach/mach_host.h:136:15: note: 'host_processor_info' declared here
:info:build kern_return_t host_processor_info
:info:build               ^
:info:build metrics.c:675:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
:info:build       err_msg(errmsg);   
:info:build               ^~~~~~
:info:build metrics.c:675:15: note: treat the string as an argument to avoid this
:info:build       err_msg(errmsg);   
:info:build               ^
:info:build               "%s", 
:info:build metrics.c:681:15: error: call to undeclared function 'host_processor_set_priv'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build       error = host_processor_set_priv(ganglia_port, psets[i], &pset);
:info:build               ^
:info:build metrics.c:684:18: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
:info:build          err_msg(errmsg);
:info:build                  ^~~~~~
:info:build metrics.c:684:18: note: treat the string as an argument to avoid this
:info:build          err_msg(errmsg);
:info:build                  ^
:info:build                  "%s", 
:info:build metrics.c:691:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
:info:build            err_msg(errmsg);
:info:build                    ^~~~~~
:info:build metrics.c:691:20: note: treat the string as an argument to avoid this
:info:build            err_msg(errmsg);
:info:build                    ^
:info:build                    "%s", 
:info:build metrics.c:701:21: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
:info:build             err_msg(errmsg);
:info:build                     ^~~~~~
:info:build metrics.c:701:21: note: treat the string as an argument to avoid this
:info:build             err_msg(errmsg);
:info:build                     ^
:info:build                     "%s", 
:info:build metrics.c:707:21: error: call to undeclared function 'thread_info'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build             error = thread_info(threads[k], THREAD_BASIC_INFO, (thread_info_t)&th_info, &count);
:info:build                     ^
:info:build metrics.c:710:24: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
:info:build                err_msg(errmsg);
:info:build                        ^~~~~~
:info:build metrics.c:710:24: note: treat the string as an argument to avoid this
:info:build                err_msg(errmsg);
:info:build                        ^
:info:build                        "%s", 
:info:build metrics.c:732:10: error: call to undeclared function 'vm_deallocate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build          vm_deallocate(mach_task_self(), (vm_address_t) threads, sizeof(threads) * thcnt);
:info:build          ^
:info:build metrics.c:732:10: note: did you mean 'mig_deallocate'?
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/mach/mig.h:174:13: note: 'mig_deallocate' declared here
:info:build extern void mig_deallocate(vm_address_t, vm_size_t);
:info:build             ^
:info:build metrics.c:744:7: error: call to undeclared function 'vm_deallocate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build       vm_deallocate(mach_task_self(), (vm_address_t)tasks, sizeof(tasks)*tcnt);
:info:build       ^
:info:build metrics.c:758:4: error: call to undeclared function 'vm_deallocate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build    vm_deallocate(mach_task_self(), (vm_address_t)psets, sizeof(psets)*pcnt);
:info:build    ^
:info:build metrics.c:640:29: warning: unused variable 'port' [-Wunused-variable]
:info:build    mach_port_t              port;               /* mach port for host */
:info:build                             ^
:info:build metrics.c:644:29: warning: unused variable 'a_task' [-Wunused-variable]
:info:build    task_info_t              a_task;
:info:build                             ^
:info:build metrics.c:645:29: warning: unused variable 'ti' [-Wunused-variable]
:info:build    task_basic_info_data_t   ti;
:info:build                             ^
:info:build metrics.c:803:48: warning: passing 'int *' to parameter of type 'mach_msg_type_number_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign]
:info:build                         (host_info_t)&vm_stat, &host_count);
:info:build                                                ^~~~~~~~~~~
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/mach/mach_host.h:248:26: note: passing argument to parameter 'host_info_outCnt' here
:info:build         mach_msg_type_number_t *host_info_outCnt
:info:build                                 ^
:info:build metrics.c:797:11: warning: unused variable 'host_port' [-Wunused-variable]
:info:build    host_t host_port;
:info:build           ^
:info:build metrics.c:861:17: warning: unused variable 'min' [-Wunused-variable]
:info:build    unsigned int min=0;
:info:build                 ^
:info:build metrics.c:980:17: error: call to undeclared function 'errx'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build                 errx(1, "iflist-sysctl-estimate");
:info:build                 ^
:info:build metrics.c:947:38: warning: variable 'sdl' set but not used [-Wunused-but-set-variable]
:info:build         struct          sockaddr_dl *sdl;
:info:build                                      ^
:info:build metrics.c:1197:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
:info:build makevfslist(fslist)
:info:build ^
:info:build metrics.c:1250:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
:info:build checkvfsname(vfsname, vfslist)
:info:build ^
:info:build metrics.c:1277:17: error: call to undeclared function 'warnx'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build                 warnx("sysctl failed"); 
:info:build                 ^
:info:build metrics.c:1282:17: error: call to undeclared function 'warnx'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build                 warnx("malloc failed");
:info:build                 ^
:info:build metrics.c:1294:41: error: call to undeclared function 'warnx'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build                                         warnx("malloc failed");
:info:build                                         ^
:info:build metrics.c:1304:25: error: call to undeclared function 'warnx'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build                         warnx("malloc failed");
:info:build                         ^
:info:build metrics.c:1316:21: warning: incompatible pointer to integer conversion assigning to 'char' from 'void *' [-Wint-conversion]
:info:build         *(--strptr) = NULL;
:info:build                     ^ ~~~~
:info:build 23 warnings and 11 errors generated.
:info:build make[4]: *** [metrics.lo] Error 1
:info:build make[4]: Leaving directory `/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_net_ganglia/ganglia/work/ganglia-3.7.2/libmetrics/darwin'
:info:build make[3]: *** [all-recursive] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_net_ganglia/ganglia/work/ganglia-3.7.2/libmetrics'
:info:build make[2]: *** [all] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_net_ganglia/ganglia/work/ganglia-3.7.2/libmetrics'
:info:build make[1]: *** [all-recursive] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_net_ganglia/ganglia/work/ganglia-3.7.2'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_net_ganglia/ganglia/work/ganglia-3.7.2'
:info:build Command failed:  cd "/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_net_ganglia/ganglia/work/ganglia-3.7.2" && /usr/bin/make -j20 -w all 
Schamschula added a commit to macports/macports-ports that referenced this issue Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant