From 36a3d2389510a2ee108ab0f0c79061391543ebd2 Mon Sep 17 00:00:00 2001 From: Lars Asplund Date: Sat, 9 Mar 2024 16:58:03 +0100 Subject: [PATCH] Added return statements after breaking asserts to avoid compiler warnings. Fixes #996. --- vunit/vhdl/data_types/src/api/external_integer_vector_pkg.vhd | 2 ++ vunit/vhdl/data_types/src/api/external_string_pkg.vhd | 2 ++ vunit/vhdl/data_types/src/string_ptr_pkg-body-2002p.vhd | 1 + 3 files changed, 5 insertions(+) diff --git a/vunit/vhdl/data_types/src/api/external_integer_vector_pkg.vhd b/vunit/vhdl/data_types/src/api/external_integer_vector_pkg.vhd index d52259488..8cae1038a 100644 --- a/vunit/vhdl/data_types/src/api/external_integer_vector_pkg.vhd +++ b/vunit/vhdl/data_types/src/api/external_integer_vector_pkg.vhd @@ -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; diff --git a/vunit/vhdl/data_types/src/api/external_string_pkg.vhd b/vunit/vhdl/data_types/src/api/external_string_pkg.vhd index 95535c611..5c32472ee 100644 --- a/vunit/vhdl/data_types/src/api/external_string_pkg.vhd +++ b/vunit/vhdl/data_types/src/api/external_string_pkg.vhd @@ -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; 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; diff --git a/vunit/vhdl/data_types/src/string_ptr_pkg-body-2002p.vhd b/vunit/vhdl/data_types/src/string_ptr_pkg-body-2002p.vhd index 541d5e1de..8d37498c6 100644 --- a/vunit/vhdl/data_types/src/string_ptr_pkg-body-2002p.vhd +++ b/vunit/vhdl/data_types/src/string_ptr_pkg-body-2002p.vhd @@ -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;