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

zig 0.10.0 compatibility #61

Open
erazor-de opened this issue Nov 23, 2022 · 1 comment
Open

zig 0.10.0 compatibility #61

erazor-de opened this issue Nov 23, 2022 · 1 comment

Comments

@erazor-de
Copy link

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
};
@mattnite
Copy link
Contributor

oh sorry this issue passed through the cracks! I'm currently working on rearchitecting regz on the rewrite branch. Once I dub SVD parsing and codgen "good enough" it'll find itself in the main branch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants