Skip to content

Commit

Permalink
Added return statements after breaking asserts to avoid compiler warn…
Browse files Browse the repository at this point in the history
…ings. Fixes #996.
  • Loading branch information
LarsAsplund committed Mar 9, 2024
1 parent 594a2c0 commit 36a3d23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vunit/vhdl/data_types/src/api/external_integer_vector_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ package body external_integer_vector_pkg is
i : integer
) return integer is begin
assert false report "EXTERNAL read_integer" severity failure;
return integer'low;
end;

impure function get_ptr (
id : integer
) return extintvec_access_t is begin
assert false report "EXTERNAL get_intvec_ptr" severity failure;
return null;
end;
end package body;
2 changes: 2 additions & 0 deletions vunit/vhdl/data_types/src/api/external_string_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ package body external_string_pkg is
i : integer
) return character is begin
assert false report "EXTERNAL read_char" severity failure;
return NUL;

This comment has been minimized.

Copy link
@nselvara

nselvara Mar 9, 2024

I think you meant null, right?

This comment has been minimized.

Copy link
@LarsAsplund

LarsAsplund Mar 9, 2024

Author Collaborator

Nope, the function returns a character and NUL is the literal representing ASCII value 0.

This comment has been minimized.

Copy link
@nselvara

nselvara Mar 9, 2024

Ah I see, something new learned. Sry for bothering.

end;

impure function get_ptr (
id : integer
) return extstring_access_t is begin
assert false report "EXTERNAL get_string_ptr" severity failure;
return null;
end;
end package body;
1 change: 1 addition & 0 deletions vunit/vhdl/data_types/src/string_ptr_pkg-body-2002p.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ package body string_ptr_pkg is
when others =>
-- @TODO Implement to_string for external models
check_external(ref, "to_string");
return "";
end case;
end;

Expand Down

0 comments on commit 36a3d23

Please sign in to comment.