# translate-c: Demote initialization of opaque types · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/35c694d614c8687ffa99ac187e60d831f9d7f29d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 35c694d614c8687ffa99ac187e60d831f9d7f29d

Requested commit: 35c694d614c8687ffa99ac187e60d831f9d7f29d

Commit: 35c694d614c8687ffa99ac187e60d831f9d7f29d

Tree: 3d81a351ae9a1cca3f6e783dd4ea40df968c0faa

Author: Evan Haas

Committer: Veikka Tuominen

## Message

```
translate-c: Demote initialization of opaque types

This fixes a segfault in translate-c that would previously occur when
initializing structs with unnamed bitfields, due to a failed assertion in
`transInitListExprRecord`. Unnamed bitfields do not have initializers,
so `transInitListExprRecord` erroneously assumes that `init_count` equals
the number of fields in the record.

Since attempting to initialize an opaque type is a syntax error in Zig,
we can just demote any attempts to initialize them.

```

## Parents

- [0dd0c9620d66afcfabaf3dcb21b636530fd0ccba](https://git.cafe/gitcafe/zig/commit/0dd0c9620d66afcfabaf3dcb21b636530fd0ccba?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/35c694d614c8687ffa99ac187e60d831f9d7f29d?format=markdown)
