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

    <tr>
        <th>Summary</th>
        <td>
            [clang-scan-deps] [P1689] Inconsistent path style for make style dependency output
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tools-extra
      </td>
    </tr>

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

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

<pre>
    Reproducer:

```
// a.h
// empty 

// a.cpp
#include "a.h"
#include <stdarg.h>
```

Use the following command to get the make style dependency information:

```
clang-scan-deps -format=p1689  -- <abs-path>/clang++  -std=c++20 a.cpp -c -o a.o -MD -MT a.ddi -MF a.dep
cat a.dep
```

we get:

```
a.ddi: \
 <absolute-path>/a.cpp \
  <absolute-path>/a.h \
 <absolute-path>/stdarg.h \
  <absolute-path>/__stdarg___gnuc_va_list.h \
  <absolute-path>/__stdarg_va_list.h \
 <absolute-path>/__stdarg_va_arg.h \
 <absolute-path>/__stdarg___va_copy.h \
 <absolute-path>/__stdarg_va_copy.h
```

But if we try to get the information by the compiler itself:

```
a.ddi: a.cpp a.h \
 <absolute-path>/stdarg.h \
  <absolute-path>/__stdarg___gnuc_va_list.h \
  <absolute-path>/__stdarg_va_list.h \
 <absolute-path>/__stdarg_va_arg.h \
 <absolute-path>/__stdarg___va_copy.h \
 <absolute-path>/__stdarg_va_copy.h
```

then we can find that the path to `a.cpp` and `a.h` is not consistency. This is problematic in cases like sandboxes.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVUFv8zYM_TXyhbChyIkTHXxomgXYocAwdMBuhizRtjZZ8iy5bf79IDtZ065tVmDHDwicUOJjHvnkJ-G9bi1iSTZ7sjkkYgqdG8v7bhL2L_37xJPaqVP5Kw6jU5PEkeR3hB4IvTwLev4sITsSdgSRdW9i7Idwgje4S6IchstKrq00k0IgjMUKjP17J7_3QYmxzTqS__Qxhfn5m0cIHULjjHHP2rYgXd8LqyA4aDHMm734E8GHk0FQOKBVaOUJtG3c2Iugnf26WWmEbVMvhU0VDh7SBUfyw7AqdhwgTSNhUft0EGEmzI4ziLA9YXuA1AdF8oNcYkaXeUAqIXUgMgfpwwHSh0cQmVIa0oc4MYXniUkRrsMP5_CMsduv-5iLk_wOyOZ-WTnTdmYKeMV9Yfea9Wlad7PURcXb1apqya2qqrWTrJ5EZbQP34J-hLkNeU_wJr8nUUk3nL75NwvkCw33UwDdwDNCGE_X5_fqpEJ9mpek6wdtcAQdPJrmPwq_CPtDt_9Xt9ChjapJYaHR0Xo6sQgXC0YhSUEXBywoRG-a4y5G2oN1AaSzXvsQfSmDx077uDGMrjYYdZegLUjh0YPR0cuEVbV7QZ8lqswVz7lIsFwVfFswytcs6coiL_KGN-sd20ikO1ogW23rHLei2fGCskSXjLJ8RVc7yhljLOO1qrc8byhfcSZwRdYUe6FNZsxTn7mxTbT3E5YFX-c8MaJG4-frhLHFIYNzxqf4EkYRPX1zSMYyYtN6aj1Z0yixf60WdDDzffTOX8nmAGSz_yV6a_z9s_1nOmGZ6GLljRs_cXY3hWEKyTSasgth8PHtmO-hVoduqjPpesKOkcj5Kx1G9wfKQNhx7tETdpzb_DsAAP__T-EuxQ">