Skip to content

translate-c segfaults on typedef'd pointer subtraction #14560

@phase

Description

@phase

Zig Version

0.11.0-dev.1568+c9b957c93

Steps to Reproduce and Observed Behavior

Using zig translate-c, I get a segfault with this case:

typedef char* S;
void foo() {
    S a, b;
    long c = a - b;
}

Looks like it has something to do with this typedef. If a and b are char*, this translates correctly.

Expected Behavior

Valid compilation or error saying why it failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviortranslate-cC to Zig source translation feature (@cImport)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions