<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/83629>83629</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang: -fstrict-volatile-bitfields flag not supported
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jstengleingithub
      </td>
    </tr>
</table>

<pre>
    -fstrict-volatile-bitfields is accepted by gcc:

https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html

-fstrict-volatile-bitfields
This option should be used if accesses to volatile bit-fields (or other structure fields, although the compiler usually honors those types anyway) should use a single access of the width of the field’s type, aligned to a natural alignment if possible. For example, targets with memory-mapped peripheral registers might require all such accesses to be 16 bits wide; with this flag you can declare all peripheral bit-fields as unsigned short (assuming short is 16 bits on these targets) to force GCC to use 16-bit accesses instead of, perhaps, a more efficient 32-bit access.

Clang does not accept it however:
```
bin/clang -fstrict-volatile-bitfields test.c
clang: error: unknown argument: '-fstrict-volatile-bitfields'
bin/clang --version
clang version 19.0.0git (https://github.com/llvm/llvm-project/ ae76dfb74701e05e5ab4be194e20e49f10768e46)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVEGP4zYP_TXKhbDhyI4TH3zYzX7Z43fpvZAt2tJWllyRmpn8-0KO000XxQAFggRixKfH90gqIjt7xF6cvorTt4NKbELsfxCjnx1aP1s2aTgMQd_7YiKOduTiLTjF1mExWJ4sOk1gCdQ44sqoYbjDPI6i_iKqb6Lavw3zSjkmb0Le5nEsZ5_KEGchb8E761GHkR5_CXm7Bo3Fd_TF_1e2wVNpeHGveJ-QeVz4zViCsGUDmZCchgEhEWqw00aWCAk4wBMBBsvFXo-QlxAhsMEIxDGNnCLCji-voBybkGYDbBDGsKzWYYRESTl3BxN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