Skip to content

Commit 06ace4e

Browse files
committed
Always use compiler builtin for offsetof()
We have received multiple reports of GCC breaking builds when compiler flags like `-std=c11` were being passed. The workaround until the next release is to simply not define `__STRICT_ANSI__` which is a bad idea.
1 parent e36283f commit 06ace4e

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

libc/integral/c.inc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,7 @@ typedef struct {
473473
#define autotype(x) typeof(x)
474474
#endif
475475

476-
#if defined(__STRICT_ANSI__) || \
477-
(!defined(__GNUC__) && !defined(__builtin_offsetof))
478-
#define offsetof(type, member) ((unsigned long)&((type *)0)->member)
479-
#else
480476
#define offsetof(type, member) __builtin_offsetof(type, member)
481-
#endif
482477

483478
#ifdef _COSMO_SOURCE
484479

libc/thread/pthread_cancel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void _pthread_cancel_sig(int sig, siginfo_t *si, void *arg) {
7171
if (pt->pt_flags & PT_NOCANCEL) return;
7272
if (!atomic_load_explicit(&pt->pt_canceled, memory_order_acquire)) return;
7373

74-
// in asynchronous mode we'll just the exit asynchronously
74+
// in asynchronous mode the asynchronous signal calls exit
7575
if (pt->pt_flags & PT_ASYNC) {
7676
sigaddset(&ctx->uc_sigmask, SIGTHR);
7777
pthread_sigmask(SIG_SETMASK, &ctx->uc_sigmask, 0);

0 commit comments

Comments
 (0)