Skip to content

Commit

Permalink
Merge pull request #756 from rust-embedded/repr-c
Browse files Browse the repository at this point in the history
Mark all Vector unions as repr(C). Fixes #755.
  • Loading branch information
burrbull authored Nov 1, 2023
2 parents 76155af + 2625b3e commit 8f73274
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- Mark `Vector` union as `repr(C)`

## [v0.30.2] - 2023-10-22

- Fix documentation warnings
Expand Down
4 changes: 4 additions & 0 deletions src/generate/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ pub fn render(
}

#[doc(hidden)]
#[repr(C)]
pub union Vector {
_handler: unsafe extern "C" fn(),
_reserved: u32,
Expand Down Expand Up @@ -167,6 +168,7 @@ pub fn render(
}

#[doc(hidden)]
#[repr(C)]
pub union Vector {
_handler: unsafe extern "msp430-interrupt" fn(),
_reserved: u16,
Expand Down Expand Up @@ -201,6 +203,7 @@ pub fn render(
}

#[doc(hidden)]
#[repr(C)]
pub union Vector {
pub _handler: unsafe extern "C" fn(),
pub _reserved: usize,
Expand Down Expand Up @@ -233,6 +236,7 @@ pub fn render(
}

#[doc(hidden)]
#[repr(C)]
pub union Vector {
pub _handler: unsafe extern "C" fn(),
_reserved: u32,
Expand Down

0 comments on commit 8f73274

Please sign in to comment.