boschresearch / blech

Blech is a language for developing reactive, real-time critical embedded software.
Apache License 2.0
72 stars 6 forks source link

Require at least one field in structs #54

Closed FriedrichGretz closed 3 years ago

FriedrichGretz commented 3 years ago

Describe the bug The compiler allows to define empty structures.

To Reproduce struct T end

Expected behaviour The type checker should flag an error

Additional context The corresponding documentation mandates this, see grammar in https://www.blech-lang.org/docs/user-manual/types/#structure-types

Furthermore standard C (unlike C++) also requires at least one field. Empty structures induce compiler dependent behaviour.