Bug#1112349: iwyu: Asks to remove anonymous structs

Charlemagne Lasse charlemagnelasse at gmail.com
Thu Aug 28 20:55:56 BST 2025


Source: iwyu
Version: 8.23-1
Severity: normal
Tags: trixie patch
Forwarded: https://github.com/include-what-you-use/include-what-you-use/issues/1804

Patch can be found at
https://github.com/include-what-you-use/include-what-you-use/commit/164937a8c307b7d072754e75ffc9787c3de134d8

Problem is that iwyu asks to remove "struct {" and fix_includes simply
does this - basically destroying the source code in the process.

Test case is:

```
#include <stdlib.h>

void *foo(size_t t, void *c);

int bar(void)
{
        struct {
                unsigned char t;
        } *pb, b;

        pb = foo(sizeof(b), &b);

        return pb->t;
}

```

Which creates the diff:

```

--- a/test.c
+++ b/test.c
@@ -4,7 +4,6 @@

 int bar(void)
 {
-        struct {
                 unsigned char t;
         } *pb, b;


```



More information about the Pkg-llvm-team mailing list