URL: <https://savannah.gnu.org/support/?110530>
Summary: Missing #include <string.h> in AC_FUNC_MEMCMP Project: Autoconf Submitted by: ryandesign Submitted on: Thu 19 Aug 2021 11:25:32 PM UTC Category: None Priority: 5 - Normal Severity: 3 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Operating System: Mac OS _______________________________________________________ Details: Hi, dfu-programmer's configure.ac uses: AC_FUNC_MEMCMP When the configure script is run with "-Werror=implicit-function-declaration" in CFLAGS (or with the clang from Xcode 12 or later where that behavior is the default), configure output contains: checking for working memcmp... no and config.log contains: conftest.c:47:7: error: implicitly declaring library function 'memcmp' with type 'int (const void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration] if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) ^ conftest.c:47:7: note: include the header <string.h> or explicitly provide a declaration for 'memcmp' conftest.c:61:2: error: implicitly declaring library function 'strcpy' with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-declaration] strcpy (a, "--------01111111"); ^ conftest.c:61:2: note: include the header <string.h> or explicitly provide a declaration for 'strcpy' 2 errors generated. I believe "#include <string.h>" should be added to AC_FUNC_MEMCMP (in lib/autoconf/functions.m4). _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/support/?110530> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/