<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58496>58496</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-Format AlignAfterOpenBracket: BlockIndent improperly breaks after function pointer name
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jaskij
</td>
</tr>
</table>
<pre>
When using Clang-Format with **C** it seems that function pointers are handled improperly. A break is inserted before the closing parenthesis after pointer name. It seems that the variable name is treated as an argument and shenanigans ensue.
Consider the following code:
```c
int (*tps25750_write
)(void* ctx,
uint8_t tps_address,
uint8_t reg_address,
uint8_t byte_count,
uint8_t* buffer);
```
I would expect it to look like this, closer to a function declaration (all my indents are set to 4 spaces):
```c
int (*tps25750_write)(
void* ctx,
uint8_t tps_address,
uint8_t reg_address,
uint8_t byte_count,
uint8_t* buffer
);
```
Full [`.clang-format`](https://gist.github.com/jaskij/e2646cb88477d47d42ab5862dd677a31/440b832497a281023313e0fbfd83c120a06b8a1d)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVMlu4zAM_Zr4QtSw5SX2wYe0RYGe5jjHgpZoR40iBZLctH8_lDOdLrMUGEOwZZF6fHwUNTr1Mnzfk4UlaDvDjUE7X905f8QIZx33sBE7HjeXD-gIgegYIO7ZYVqsjNpZODltI_kA6An2aJUhBfp48u5E3rzksIPREx5AB9A2kI9sH2ly7B73BNK4NfyJ91teCOyHEyO-IoPFI-Vw_yF82vmEXuNoaHVI8JHjJHRkBMt85uXIkDxXEDhPtHpGG4BsWCjfFLebYnd53zgbtOJQCXZyxrhzoiSdok21e--5aYvLkJd_ZsgydaxPPAXRbJvi4ex1pJ_eomfjk9MqCciPjM8bcXMxAiy8u3uIALz3AZXyFMKfzJ7mf5nHl0gP0i02_m5NccdlmsgnLtX1pyzep3YPZ7cYBfR8IhlTuaMD49wBjD6kWukUfa1XUsoBvh0CRdKgx3XOGaMxcHzhcivW_3IyAq14NYQTSgorm_9TdtX0NU2Av6r7pb5fKvyVxn9S-ZfpS73vFlZp01zzci7X3pvW3ktuzS3nuI_MO6kk7njMOsR85rZcxly6I688YjjoR56QaOtWjl1Xb7eq5iFwbLpWKNVut1iV7FLXxdhVou63KLqyEFVVVlRM46S6SpaiwKIdOyxZyT6joWzbVrRtJdpMDZXqqx6zqKOh4cMlsTN6trvUq99OZK89ygNFJgzXxsnD_Vr9d1fB5R547e7PF8jaxdnizfA573cpG_P0-rli2Ec-qPyrAzc0F-6u6eq-zfYD1lUry6lo6qlut1KNqLpuFEoI7Ou-mTKDI5kwJPWFsHSGFYLnrHymB1EIwSIVZVk3os0bUTbVVhRFjUVHfbepCzqiNnnikTs_Z35YKY3LHNhouFThzYghsE5EazjGxyXunR8u5cvWyMPK_Ad0srpJ">