commit 9ea53c5

Michael Forney  ·  2026-05-03 04:45:56 +0000 UTC
parent 421f3e5
the_silver_searcher: Use C11 alignment attributes
2 files changed,  +48, -1
+47, -0
 1@@ -0,0 +1,47 @@
 2+From fa8a0ee0f3060807240fa402569f9c9e71cdfefe Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Sat, 2 May 2026 21:45:23 -0700
 5+Subject: [PATCH] Use C11 alignas instead of GNU alignment attribute
 6+
 7+---
 8+ src/search.c | 2 +-
 9+ src/search.h | 3 ++-
10+ 2 files changed, 3 insertions(+), 2 deletions(-)
11+
12+diff --git a/src/search.c b/src/search.c
13+index 2245818..b65e2d5 100644
14+--- a/src/search.c
15++++ b/src/search.c
16+@@ -4,7 +4,7 @@
17+ 
18+ size_t alpha_skip_lookup[256];
19+ size_t *find_skip_lookup;
20+-uint8_t h_table[H_SIZE] __attribute__((aligned(64)));
21++alignas(64) uint8_t h_table[H_SIZE];
22+ 
23+ work_queue_t *work_queue;
24+ work_queue_t *work_queue_tail;
25+diff --git a/src/search.h b/src/search.h
26+index a1bc5d7..96420aa 100644
27+--- a/src/search.h
28++++ b/src/search.h
29+@@ -6,6 +6,7 @@
30+ #include <fcntl.h>
31+ #include <limits.h>
32+ #include <pcre.h>
33++#include <stdalign.h>
34+ #include <stdio.h>
35+ #include <stdlib.h>
36+ #include <string.h>
37+@@ -33,7 +34,7 @@
38+ 
39+ extern size_t alpha_skip_lookup[256];
40+ extern size_t *find_skip_lookup;
41+-extern uint8_t h_table[H_SIZE] __attribute__((aligned(64)));
42++extern alignas(64) uint8_t h_table[H_SIZE];
43+ 
44+ struct work_queue_t {
45+     char *path;
46+-- 
47+2.49.0
48+
+1, -1
1@@ -1 +1 @@
2-2.2.0 r0
3+2.2.0 r3