Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

zig 0.10.0 compatibility #61

@erazor-de

Description

@erazor-de

I tried to use regz to convert a svg for an STM32F103 and stumbled over the following problems:

The compiler complains

/home/stefan/workspace/stm32f103rb-test/src/registers.zig:31630:5: error: extern unions cannot contain fields of type 'fn() callconv(.C) void'
    C: fn () callconv(.C) void,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/stefan/workspace/stm32f103rb-test/src/registers.zig:31630:5: note: type has no guaranteed in-memory representation
/home/stefan/workspace/stm32f103rb-test/src/registers.zig:31630:5: note: use '*const ' to make a function pointer type
referenced by:
    InterruptVector: /home/stefan/workspace/stm32f103rb-test/src/registers.zig:31629:36
    unhandled: /home/stefan/workspace/stm32f103rb-test/src/registers.zig:31635:19
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

My corrected, working, definition looks so:

pub const InterruptVector = extern union {
    C: *const fn () callconv(.C) void,
    Naked: *const fn () callconv(.Naked) void,
    // Interrupt is not supported on arm
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions