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

    <tr>
        <th>Summary</th>
        <td>
            Using clang as CPP makes unexpected indentation changes
        </td>
    </tr>

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

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

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

<pre>
    For background, over in [U-Boot](https://docs.u-boot.org/) we use the same "Kconfig" language as the Linux kernel, and so have a config file for a build that is defined with `CONFIG_FOO=y` and `# CONFIG_BAR is not set`. What we're doing now is allowing for a config file to `#include` another valid config file fragment, and using `$(CC) -E` to handle the include directive.

When using GCC, this works as expected and nothing about the files is changed. However, with clang-16 `# CONFIG_FOO is not set` becomes ` # CONFIG_FOO is not set`, which is invalid for the Kconfig language. I can pass in `-traditional-cpp` as another flag and in _some_ cases this will keep the expected behavior, but in others, it does not.

I've put an example of what I'm doing at: https://gist.github.com/trini/a9fec05a1010611f287661e58b17cbd0 which shows the trivial case. Using the [starfive_visionfive2_defconfig](https://source.denx.de/u-boot/u-boot/-/raw/master/configs/starfive_visionfive2_defconfig) file as non-trivial testcase shows that even with `-traditional-cpp` we still get some whitespace changes.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8lE9v4zgPxj-NciFi2EriJAcf2vT1vMUutoMFBnMsaIm2tZGlQJLtzrdfSHaz7WAwl_yRqYfkjw-N3qvOEFXs8MgOTxscQ29dFZwyatNY-aOqrYMGxbVzdjSS8QvYiRwoA-zw-G37aG1ghyfGT30IN892D4zXjNfSCp-N28bakFnXpcMzzASjJwg9gceBgHH-h7CmVR3jHDSabsSOAH0K-VOZ8Q2u5AzpmBiNBG-hx4kAYbkHrdIErXWA0IxKSwg9BlAeJLXKkIRZhR5YmV9e_qqfv7zWLy9s9_SDlXnSY2XO-A7Wh48Pf8erxg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