Is there a tool for this? It’d be handy.
-vet-unused-variables does not spot unused struct fields.
I understand that we might have fields for alignment and struct size matters, but that could be handled with a _ prefix.
Is there a tool for this? It’d be handy.
-vet-unused-variables does not spot unused struct fields.
I understand that we might have fields for alignment and struct size matters, but that could be handled with a _ prefix.
This doesn’t really make much sense because how can the compiler even know if that is is unused or not? And maybe they are used as padding or other field alignment.
I don’t think is possible to solve.
This doesn’t really make much sense because how can the compiler even know if that is is unused or not?
By checking if there is anything else in the code reading the fields. This feature is in many other languages.
And maybe they are used as padding or other field alignment.
I addressed this
Other languages are not systems level programming languages. The layout of a struct matters.
And you did not address this because it’s not as simple as you are making out.