[MacPorts] #62303: mcpp @2.7.2_5: error: implicitly declaring library function 'stpcpy'

MacPorts noreply at macports.org
Mon Feb 15 17:20:26 UTC 2021


#62303: mcpp @2.7.2_5: error: implicitly declaring library function 'stpcpy'
-----------------------------+--------------------
 Reporter:  cooljeanius      |      Owner:  (none)
     Type:  defect           |     Status:  new
 Priority:  Normal           |  Milestone:
Component:  ports            |    Version:  2.6.4
 Keywords:  bigsur catalina  |       Port:  mcpp
-----------------------------+--------------------
 Another victim of -Werror=implicit-function-declaration being on by
 default now:
 {{{
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c main.c  -fno-common -DPIC -o .libs/main.o
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c mbchar.c  -fno-common -DPIC -o .libs/mbchar.o
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c system.c  -fno-common -DPIC -o .libs/system.o
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c directive.c  -fno-common -DPIC -o .libs/directive.o
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c support.c  -fno-common -DPIC -o .libs/support.o
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c eval.c  -fno-common -DPIC -o .libs/eval.o
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c expand.c  -fno-common -DPIC -o .libs/expand.o
 main.c:779:23: error: implicitly declaring library function 'stpcpy' with
 type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-
 declaration]
                 cp1 = stpcpy( output, "pragma ");   /* From top of buffer
 */
                       ^
 main.c:779:23: note: include the header <string.h> or explicitly provide a
 declaration for 'stpcpy'
 1 error generated.
 make[2]: *** [main.lo] Error 1
 make[2]: *** Waiting for unfinished jobs....
 system.c:2510:20: error: implicit declaration of function 'readlink' is
 invalid in C99 [-Werror,-Wimplicit-function-declaration]
         if ((len = readlink( slbuf1, slbuf2, PATHMAX)) > 0) {
                    ^
 system.c:2623:15: error: implicitly declaring library function 'stpcpy'
 with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-
 declaration]
         cp1 = stpcpy( abs_path, cur_work_dir);
               ^
 system.c:2623:15: note: include the header <string.h> or explicitly
 provide a declaration for 'stpcpy'
 system.c:2685:20: error: implicit declaration of function 'readlink' is
 invalid in C99 [-Werror,-Wimplicit-function-declaration]
         if ((len = readlink( slbuf1, slbuf2, PATHMAX)) > 0) {
                    ^
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c mbchar.c -o mbchar.o >/dev/null 2>&1
 support.c:530:19: error: implicitly declaring library function 'stpcpy'
 with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-
 declaration]
             out = stpcpy( out, identifier);
                   ^
 support.c:530:19: note: include the header <string.h> or explicitly
 provide a declaration for 'stpcpy'
 system.c:4245:20: warning: assigning to 'char *' from 'const char *'
 discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
     once_end->name = fullname;
                    ^ ~~~~~~~~
 directive.c:1212:20: error: implicitly declaring library function 'stpcpy'
 with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-
 declaration]
         repl_cur = stpcpy( repl_cur, identifier);
                    ^
 directive.c:1212:20: note: include the header <string.h> or explicitly
 provide a declaration for 'stpcpy'
 1 warning and 3 errors generated.
 support.c:1590:15: warning: passing 'const char *' to parameter of type
 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-
 qualifiers]
         free( file->src_dir);
               ^~~~~~~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:42:18:
 note: passing argument to parameter here
 void     free(void *);
                     ^
 support.c:1596:15: warning: passing 'const char *' to parameter of type
 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-
 qualifiers]
         free( file->src_dir);               /* Free src_dir         */
               ^~~~~~~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:42:18:
 note: passing argument to parameter here
 void     free(void *);
                     ^
 support.c:1599:22: warning: assigning to 'char *' from 'const char *'
 discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
         cur_fullname = infile->full_fname;
                      ^ ~~~~~~~~~~~~~~~~~~
 1 error generated.
 expand.c:427:16: error: implicitly declaring library function 'stpcpy'
 with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-
 declaration]
         *opp = stpcpy( *opp, "*/");
                ^
 expand.c:427:16: note: include the header <string.h> or explicitly provide
 a declaration for 'stpcpy'
 support.c:2303:17: warning: passing 'const char *' to parameter of type
 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-
 qualifiers]
         strcpy( file->src_dir, src_dir);
                 ^~~~~~~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:27:
 note: expanded from macro 'strcpy'
                 __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz
 (dest))
                                         ^~~~
 make[2]: *** [system.lo] Error 1
 expand.c:713:21: warning: incompatible pointer types assigning to 'char *'
 from 'LOCATION *' (aka 'struct location *') [-Wincompatible-pointer-types]
         m_inf->args = m_inf->loc_args = NULL;       /* Default args */
                     ^ ~~~~~~~~~~~~~~~~~~~~~~
 make[2]: *** [directive.lo] Error 1
 4 warnings and 1 error generated.
 make[2]: *** [support.lo] Error 1
 expand.c:1975:41: warning: assigning to 'char *' from 'const char *'
 discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                             mgc_cleared = remove_magics(
                                         ^ ~~~~~~~~~~~~~~
 2 warnings and 1 error generated.
 make[2]: *** [expand.lo] Error 1
  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -c eval.c -o eval.o >/dev/null 2>&1
 make[2]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mcpp/mcpp/work/mcpp-2.7.2/src'
 make[1]: *** [all] Error 2
 make[1]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mcpp/mcpp/work/mcpp-2.7.2/src'
 make: *** [all-recursive] Error 1
 make: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mcpp/mcpp/work/mcpp-2.7.2'
 Command failed:  cd
 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mcpp/mcpp/work/mcpp-2.7.2"
 && /usr/bin/make -j16 -w all CFLAGS+='-arch x86_64'
 Exit code: 2
 Error: Failed to build mcpp: command execution failed
 DEBUG: Error code: CHILDSTATUS 54467 2
 }}}

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


More information about the macports-tickets mailing list