Skip to content

Commit

Permalink
util/consideredharmful: Use overloadable func attribute with clang
Browse files Browse the repository at this point in the history
When building with glibc HEAD, it has fortified headers with clang as well
and clang reports errors e.g.

| ../git/src/util/consideredharmful.h:33:7: error: redeclaration of 'strncat' must have the 'overloadable' attribute
|    33 | char* strncat();
|       |       ^
| /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/taisei/1.4.2/recipe-sysroot/usr/include/bits/string_fortified.h:145:8: note: previous overload of function is here
|   145 | __NTH (strncat (__fortify_clang_overload_arg (char *, __restrict, __dest),
|       |        ^
  • Loading branch information
kraj committed Nov 22, 2024
1 parent ed37f0c commit febda62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/consideredharmful.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ FILE* fopen();

#undef strncat
attr_deprecated("This function likely doesn't do what you expect, use strlcat")
char* strncat();
char* __attribute__((overloadable)) strncat();

#undef strncpy
attr_deprecated("This function likely doesn't do what you expect, use strlcpy")
char* strncpy();
char* __attribute__((overloadable)) strncpy();

#undef errx
attr_deprecated("Use log_fatal instead")
Expand Down

0 comments on commit febda62

Please sign in to comment.