jfs: Rename _inline to avoid conflict with clang's '-fms-extensions'

Building fs/jfs with clang and '-fms-extensions' errors with:

  In file included from fs/jfs/jfs_unicode.c:8:
  fs/jfs/jfs_incore.h:86:13: error: type name does not allow function specifier to be specified
     86 |                                         unchar _inline[128];
        |                                                ^
  fs/jfs/jfs_incore.h:86:20: error: expected member name or ';' after declaration specifiers
     86 |                                         unchar _inline[128];
        |                                         ~~~~~~~~~~~~~~^

'-fms-extensions' in clang enables several other Microsoft specific
keywords such as _inline [1], presumably for compatibility with MSVC, as
Microsoft's documentation [2] mentions:

  For compatibility with previous versions, _inline and _forceinline are
  synonyms for __inline and __forceinline, respectively

Rename the _inline array in 'struct jfs_inode_info' to _inline_sym to
avoid this conflict, which is not a large workaround as this member is
only ever referred to via the i_inline macro.

Link: 249883d0c5/clang/include/clang/Basic/TokenKinds.def (L744-L79) [1]
Link: https://learn.microsoft.com/en-us/cpp/c-language/inline-functions [2]
Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Link: https://patch.msgid.link/20251023-jfs-fix-conflict-with-clang-ms-ext-v1-1-e219d59a1e68@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
Nathan Chancellor 2025-10-23 10:38:50 -07:00
parent 3a86608788
commit a6773e6932
No known key found for this signature in database
GPG Key ID: 1D6B269171C01A96
1 changed files with 3 additions and 3 deletions

View File

@ -76,14 +76,14 @@ struct jfs_inode_info {
struct { struct {
unchar _unused[16]; /* 16: */ unchar _unused[16]; /* 16: */
dxd_t _dxd; /* 16: */ dxd_t _dxd; /* 16: */
/* _inline may overflow into _inline_ea when needed */ /* _inline_sym may overflow into _inline_ea when needed */
/* _inline_ea may overlay the last part of /* _inline_ea may overlay the last part of
* file._xtroot if maxentry = XTROOTINITSLOT * file._xtroot if maxentry = XTROOTINITSLOT
*/ */
union { union {
struct { struct {
/* 128: inline symlink */ /* 128: inline symlink */
unchar _inline[128]; unchar _inline_sym[128];
/* 128: inline extended attr */ /* 128: inline extended attr */
unchar _inline_ea[128]; unchar _inline_ea[128];
}; };
@ -101,7 +101,7 @@ struct jfs_inode_info {
#define i_imap u.file._imap #define i_imap u.file._imap
#define i_dirtable u.dir._table #define i_dirtable u.dir._table
#define i_dtroot u.dir._dtroot #define i_dtroot u.dir._dtroot
#define i_inline u.link._inline #define i_inline u.link._inline_sym
#define i_inline_ea u.link._inline_ea #define i_inline_ea u.link._inline_ea
#define i_inline_all u.link._inline_all #define i_inline_all u.link._inline_all