# translate-c: Improve array support · gitcafe/zig

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

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

Visibility: public

Requested revision: 57b2176e28fd336309922cc9182cffcf084c1879

Requested commit: 57b2176e28fd336309922cc9182cffcf084c1879

Commit: 57b2176e28fd336309922cc9182cffcf084c1879

Tree: fe2b08e3caadde89b3b276ecf59d59c652c11adc

Author: Evan Haas

Committer: Andrew Kelley

## Message

```
translate-c: Improve array support

1. For incomplete arrays with initializer list (`int x[] = {1};`) use the
initializer size as the array size.

2. For arrays initialized with a string literal translate it as an array
of character literals instead of `[*c]const u8`

3. Don't crash if an empty initializer is used for an incomplete array.

4. Add a test for multi-character character constants

Additionally lay some groundwork for supporting wide string literals.

fixes #4831 #7832 #7842

```

## Parents

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

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