master hovercats/oakiss / pkg / e2fsprogs / patch / 0004-Use-C11-alignas-instead-of-alignment-attribute.patch
 1From f1314a4699e2e7bad5504ea860cdc5a0fe81225f Mon Sep 17 00:00:00 2001
 2From: Michael Forney <mforney@mforney.org>
 3Date: Tue, 5 May 2026 16:31:39 -0700
 4Subject: [PATCH] Use C11 alignas instead of alignment attribute
 5
 6---
 7 lib/ext2fs/rbtree.h | 6 ++++--
 8 misc/tune2fs.c      | 7 ++++---
 9 2 files changed, 8 insertions(+), 5 deletions(-)
10
11diff --git a/lib/ext2fs/rbtree.h b/lib/ext2fs/rbtree.h
12index d9116d91..2809626f 100644
13--- a/lib/ext2fs/rbtree.h
14+++ b/lib/ext2fs/rbtree.h
15@@ -94,13 +94,15 @@ static inline struct page * rb_insert_page_cache(struct inode * inode,
16 #ifndef	_LINUX_RBTREE_H
17 #define	_LINUX_RBTREE_H
18 
19+#include <stdalign.h>
20 #include <stdlib.h>
21 #include <stdint.h>
22 #include "compiler.h"
23 
24-/* The alignment might seem pointless, but allegedly CRIS needs it */
25-struct __attribute__((aligned(sizeof(long)))) rb_node
26+struct rb_node
27 {
28+	/* The alignment might seem pointless, but allegedly CRIS needs it */
29+	alignas(long)
30 	uintptr_t  rb_parent_color;
31 #define	RB_RED		0
32 #define	RB_BLACK	1
33diff --git a/misc/tune2fs.c b/misc/tune2fs.c
34index 4200104e..ace381b7 100644
35--- a/misc/tune2fs.c
36+++ b/misc/tune2fs.c
37@@ -36,6 +36,7 @@ extern char *optarg;
38 extern int optind;
39 #endif
40 #include <pwd.h>
41+#include <stdalign.h>
42 #include <stdio.h>
43 #ifdef HAVE_STDLIB_H
44 #include <stdlib.h>
45@@ -251,7 +252,7 @@ static int remove_journal_device(ext2_filsys fs)
46 {
47 	char		*journal_path;
48 	ext2_filsys	jfs;
49-	char		buf[SUPERBLOCK_SIZE] __attribute__ ((aligned(8)));
50+	alignas(8) char	buf[SUPERBLOCK_SIZE];
51 	journal_superblock_t	*jsb;
52 	int		i, nr_users;
53 	errcode_t	retval;
54@@ -2868,7 +2869,7 @@ fs_update_journal_user(struct ext2_super_block *sb, __u8 old_uuid[UUID_SIZE])
55 	__u8 *j_uuid;
56 	char *journal_path;
57 	char uuid[UUID_STR_SIZE];
58-	char buf[SUPERBLOCK_SIZE] __attribute__ ((aligned(8)));
59+	alignas(8) char buf[SUPERBLOCK_SIZE];
60 
61 	if (!ext2fs_has_feature_journal(sb) || uuid_is_null(sb->s_journal_uuid))
62 		return 0;
63@@ -3269,7 +3270,7 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
64 	if (U_flag) {
65 		int set_csum = 0;
66 		dgrp_t i;
67-		char buf[SUPERBLOCK_SIZE] __attribute__ ((aligned(8)));
68+		alignas(8) char buf[SUPERBLOCK_SIZE];
69 		__u8 old_uuid[UUID_SIZE];
70 
71 		if (ext2fs_has_feature_stable_inodes(fs->super)) {
72-- 
732.49.0
74