[MacPorts] #63244: memcachedb @1.2.0_2: error: implicit declaration of function 'free' is invalid in C99

MacPorts noreply at macports.org
Tue Jul 13 04:34:43 UTC 2021


#63244: memcachedb @1.2.0_2: error: implicit declaration of function 'free' is
invalid in C99
-----------------------------+------------------------
 Reporter:  cooljeanius      |      Owner:  (none)
     Type:  defect           |     Status:  new
 Priority:  Normal           |  Milestone:
Component:  ports            |    Version:  2.7.1
 Keywords:  bigsur catalina  |       Port:  memcachedb
-----------------------------+------------------------
 Another victim of `-Werror=implicit-function-declaration` being on by
 default now:
 {{{
 make[2]: Entering directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_memcachedb/memcachedb/work/memcachedb-1.2.0'
 /usr/bin/clang -DHAVE_CONFIG_H -I.   -I/usr/local/BerkeleyDB.4.7/include
 -I/opt/local/include -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk  -pipe -Os
 -I/opt/local/include/db47
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch
 x86_64 -MT memcachedb.o -MD -MP -MF .deps/memcachedb.Tpo -c -o
 memcachedb.o memcachedb.c
 /usr/bin/clang -DHAVE_CONFIG_H -I.   -I/usr/local/BerkeleyDB.4.7/include
 -I/opt/local/include -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk  -pipe -Os
 -I/opt/local/include/db47
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch
 x86_64 -MT item.o -MD -MP -MF .deps/item.Tpo -c -o item.o item.c
 /usr/bin/clang -DHAVE_CONFIG_H -I.   -I/usr/local/BerkeleyDB.4.7/include
 -I/opt/local/include -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk  -pipe -Os
 -I/opt/local/include/db47
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch
 x86_64 -MT thread.o -MD -MP -MF .deps/thread.Tpo -c -o thread.o thread.c
 /usr/bin/clang -DHAVE_CONFIG_H -I.   -I/usr/local/BerkeleyDB.4.7/include
 -I/opt/local/include -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk  -pipe -Os
 -I/opt/local/include/db47
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch
 x86_64 -MT bdb.o -MD -MP -MF .deps/bdb.Tpo -c -o bdb.o bdb.c
 /usr/bin/clang -DHAVE_CONFIG_H -I.   -I/usr/local/BerkeleyDB.4.7/include
 -I/opt/local/include -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk  -pipe -Os
 -I/opt/local/include/db47
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch
 x86_64 -MT stats.o -MD -MP -MF .deps/stats.Tpo -c -o stats.o stats.c
 stats.c:120:9: error: implicit declaration of function 'free' is invalid
 in C99 [-Werror,-Wimplicit-function-declaration]
         free(statp);
         ^
 stats.c:137:9: error: implicit declaration of function 'free' is invalid
 in C99 [-Werror,-Wimplicit-function-declaration]
         free(statp);
         ^
 stats.c:233:9: error: implicit declaration of function 'free' is invalid
 in C99 [-Werror,-Wimplicit-function-declaration]
         free(list);
         ^
 mv -f .deps/thread.Tpo .deps/thread.Po
 3 errors generated.
 make[2]: *** [stats.o] Error 1
 make[2]: *** Waiting for unfinished jobs....
 item.c:191:67: warning: format specifies type 'int' but the argument has
 type 'size_t' (aka 'unsigned long') [-Wformat]
             fprintf(stderr, "ntotal: %d, use free() directly.\n", ntotal);
                                      ~~                           ^~~~~~
                                      %zu
 item.c:197:107: warning: format specifies type 'int' but the argument has
 type 'size_t' (aka 'unsigned long') [-Wformat]
                 fprintf(stderr, "ntotal: %d, add a item buffer to freelist
 fail, use free() directly.\n", ntotal);
                                          ~~
 ^~~~~~
                                          %zu
 item.c:202:81: warning: format specifies type 'int' but the argument has
 type 'size_t' (aka 'unsigned long') [-Wformat]
                 fprintf(stderr, "ntotal: %d, add a item buffer to
 freelist.\n", ntotal);
                                          ~~
 ^~~~~~
                                          %zu
 memcachedb.c:844:57: warning: format specifies type 'int' but the argument
 has type 'unsigned long' [-Wformat]
         pos += sprintf(pos, "STAT pointer_size %d\r\n", 8 * sizeof(void
 *));
                                                ~~       ^~~~~~~~~~~~~~~~~~
                                                %lu
 /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/secure/_stdio.h:47:56:
 note: expanded from macro 'sprintf'
   __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                        ^~~~~~~~~~~
 memcachedb.c:846:86: warning: format specifies type 'long' but the
 argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
         pos += sprintf(pos, "STAT rusage_user %ld.%06ld\r\n",
 usage.ru_utime.tv_sec, usage.ru_utime.tv_usec);
                                                   ~~~~~
 ^~~~~~~~~~~~~~~~~~~~~~
                                                   %06d
 /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/secure/_stdio.h:47:56:
 note: expanded from macro 'sprintf'
   __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                        ^~~~~~~~~~~
 memcachedb.c:847:88: warning: format specifies type 'long' but the
 argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
         pos += sprintf(pos, "STAT rusage_system %ld.%06ld\r\n",
 usage.ru_stime.tv_sec, usage.ru_stime.tv_usec);
                                                     ~~~~~
 ^~~~~~~~~~~~~~~~~~~~~~
                                                     %06d
 /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/secure/_stdio.h:47:56:
 note: expanded from macro 'sprintf'
   __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                        ^~~~~~~~~~~
 memcachedb.c:849:57: warning: format specifies type 'unsigned int' but the
 argument has type 'size_t' (aka 'unsigned long') [-Wformat]
         pos += sprintf(pos, "STAT ibuffer_size %u\r\n",
 settings.item_buf_size);
                                                ~~
 ^~~~~~~~~~~~~~~~~~~~~~
                                                %zu
 /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/secure/_stdio.h:47:56:
 note: expanded from macro 'sprintf'
   __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                        ^~~~~~~~~~~
 memcachedb.c:2602:15: warning: 'daemon' is deprecated: first deprecated in
 macOS 10.5 - Use posix_spawn APIs instead. [-Wdeprecated-declarations]
         res = daemon(maxcore, settings.verbose);
               ^
 /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/stdlib.h:292:6:
 note: 'daemon' has been explicitly marked deprecated here
 int      daemon(int, int) __DARWIN_1050(daemon)
 __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0,
 __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED
 __TVOS_PROHIBITED;
          ^
 3 warnings generated.
 mv -f .deps/item.Tpo .deps/item.Po
 mv -f .deps/bdb.Tpo .deps/bdb.Po
 5 warnings generated.
 mv -f .deps/memcachedb.Tpo .deps/memcachedb.Po
 make[2]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_memcachedb/memcachedb/work/memcachedb-1.2.0'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_memcachedb/memcachedb/work/memcachedb-1.2.0'
 make: *** [all] Error 2
 make: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_memcachedb/memcachedb/work/memcachedb-1.2.0'
 Command failed:  cd
 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_memcachedb/memcachedb/work/memcachedb-1.2.0"
 && /usr/bin/make -j16 -w all
 Exit code: 2
 Error: Failed to build memcachedb: command execution failed
 DEBUG: Error code: CHILDSTATUS 12136 2
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/63244>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list