Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compilation error due to new strlcpy function that glibc added
The crash-utility has its own strlcpy(), but recently the latest glibc has also implemented the strlcpy function, which is derived from OpenBSD. Eventually this caused the following compilation error: # make -j8 lzo ... In file included from global_data.c:18: defs.h:5556:8: error: conflicting types for ‘strlcpy’; have ‘size_t(char *, char *, size_t)’ {aka ‘long unsigned int(char *, char *, long unsigned int)’} 5556 | size_t strlcpy(char *, char *, size_t); | ^~~~~~~ In file included from memory.c:19: defs.h:5556:8: error: conflicting types for ‘strlcpy’; have ‘size_t(char *, char *, size_t)’ {aka ‘long unsigned int(char *, char *, long unsigned int)’} 5556 | size_t strlcpy(char *, char *, size_t); | ^~~~~~~ ... To fix the issue, let's declare the strlcpy() as a weak function and keep the same parameter types as the glibc function has. Related glibc commits: 454a20c8756c ("Implement strlcpy and strlcat [BZ crash-utility#178]") d2fda60e7c40 ("manual: Manual update for strlcat, strlcpy, wcslcat, wclscpy") 388ae538ddcb ("hurd: Add strlcpy, strlcat, wcslcpy, wcslcat to libc.abilist") Signed-off-by: Lianbo Jiang <[email protected]>
- Loading branch information