<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/152818>152818</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
pp-parse invalid yaml generated when parsing a macro with placeholders
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DrKatieL
</td>
</tr>
</table>
<pre>
Description:
When parsing a macro with empty options pp-trace-20 generates yaml with empty options. While this valid C/C++ code, it isn’t valid yaml with according to either RedHat’s VScode Yaml linter (attached) or pyyaml. The issue was discovered when running pp-trace-20 on a C file that indirectly included "mathcalls-helper-functions.h”, a header file from glibc (attached). The code which included this file successfully compiles using Clang, so I believe the issue solely impacts the output yaml for pp-parse.
"mathcalls-helper-functions.h" macro definitions:
<img width="1256" height="962" alt="Image" src="https://github.com/user-attachments/assets/54ce4ce0-d3d7-4839-aacd-5f0976c265f6" />
Error in yaml produced by pp-trace. The error is caused by ", ," in args.:
<img width="1112" height="222" alt="Image" src="https://github.com/user-attachments/assets/d2fbf22c-acce-4f00-a0ea-421b967a90c1" />
Environment:
Ubuntu 25.04 Arm64 with pp-trace version information “Ubuntu LLVM version 20.1.2 Optimized build.”
pp-trace invoked with "pp-trace-20 uses_header.c -- -I(path/to/include)"
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VM2u4zYPfRplQ9iQGduJF17cSSb4Bt8UBfozg64KWaJttbJkSHKC9OkL2cm9g-m0XXWVhCEPeY54KELQgyVqWfWOVeedWOLofHv2_xdR08dd59S9PVOQXs9RO8v2L4y_fB7Jwix80HYAAZOQ3sFNxxFomuMd3JobYJ6z6IWkDDkMZMmLSAHuYjLfyM7h86gNQRx1gKswWsGJ4eXE8B3DdyCdIoYn0BF0sOw9siNnTRMfqW-gQkrnVZosOiAdR_LwA6n_ifhaFODTjwkPfklVRttIHhgeRYxCjqQYNuA8zPeEmsNPI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