Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/libthr/thread/thr_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ _thread_printf(int fd, const char *fmt, ...)
va_end(ap);
}

/* GCC has had this for a long while now, but Clang only got it
recently. */
#if __has_attribute(__nonstring__)
# define __nonstring __attribute__((__nonstring__))
#else
# define __nonstring
#endif

void
_thread_vprintf(int fd, const char *fmt, va_list ap)
{
static const char digits[16] = "0123456789abcdef";
__nonstring static const char digits[16] = "0123456789abcdef";
char buf[20];
char *s;
unsigned long r, u;
Expand Down
10 changes: 9 additions & 1 deletion libexec/rtld-elf/rtld.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,20 @@ static void (*rtld_exit_ptr)(void);
ld_utrace_log(e, h, mb, ms, r, n); \
} while (0)

/* GCC has had this for a long while now, but Clang only got it
recently. */
#if __has_attribute(__nonstring__)
# define __nonstring __attribute__((__nonstring__))
#else
# define __nonstring
#endif

static void
ld_utrace_log(int event, void *handle, void *mapbase, size_t mapsize,
int refcnt, const char *name)
{
struct utrace_rtld ut;
static const char rtld_utrace_sig[RTLD_UTRACE_SIG_SZ] = RTLD_UTRACE_SIG;
__nonstring static const char rtld_utrace_sig[RTLD_UTRACE_SIG_SZ] = RTLD_UTRACE_SIG;

memset(&ut, 0, sizeof(ut)); /* clear holes */
memcpy(ut.sig, rtld_utrace_sig, sizeof(ut.sig));
Expand Down