Skip to content

Commit

Permalink
Switch to C11 noreturn to work around a compiler bug in llvm.
Browse files Browse the repository at this point in the history
Elliott said:

Works around a clang bug in the version of clang shipping with Android T
that causes a miscompile in xstdio_create() on x86-64, that oddly only
affects __attribute__((__noreturn__)) and not _Noreturn!
  • Loading branch information
landley committed May 11, 2022
1 parent 9f5fb9a commit 3625a26
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ struct dirtree *dirtree_read(char *path, int (*callback)(struct dirtree *node));
// xwrap.c
void xstrncpy(char *dest, char *src, size_t size);
void xstrncat(char *dest, char *src, size_t size);
void _xexit(void) __attribute__((__noreturn__));
void xexit(void) __attribute__((__noreturn__));
_Noreturn void _xexit(void);
_Noreturn void xexit(void);
void *xmmap(void *addr, size_t length, int prot, int flags, int fd, off_t off);
void *xmalloc(size_t size);
void *xzalloc(size_t size);
Expand Down Expand Up @@ -189,13 +189,13 @@ time_t xmktime(struct tm *tm, int utc);
void verror_msg(char *msg, int err, va_list va);
void error_msg(char *msg, ...) printf_format;
void perror_msg(char *msg, ...) printf_format;
void error_exit(char *msg, ...) printf_format __attribute__((__noreturn__));
void perror_exit(char *msg, ...) printf_format __attribute__((__noreturn__));
void help_exit(char *msg, ...) printf_format __attribute__((__noreturn__));
_Noreturn void error_exit(char *msg, ...) printf_format;
_Noreturn void perror_exit(char *msg, ...) printf_format;
_Noreturn void help_exit(char *msg, ...) printf_format;
void error_msg_raw(char *msg);
void perror_msg_raw(char *msg);
void error_exit_raw(char *msg) __attribute__((__noreturn__));
void perror_exit_raw(char *msg) __attribute__((__noreturn__));
_Noreturn void error_exit_raw(char *msg);
_Noreturn void perror_exit_raw(char *msg);
ssize_t readall(int fd, void *buf, size_t len);
ssize_t writeall(int fd, void *buf, size_t len);
off_t lskip(int fd, off_t offset);
Expand Down

0 comments on commit 3625a26

Please sign in to comment.