# Rand\_pkg.vhd causes "Range 1 to 0 is null" Warning (vcom-1246)

**URL:** <https://forum.uvvm.org/t/rand-pkg-vhd-causes-range-1-to-0-is-null-warning-vcom-1246/249>\
**Category:** Utility Library\
**Created:** [December 13, 2021, 9:55am UTC](https://forum.uvvm.org/t/rand-pkg-vhd-causes-range-1-to-0-is-null-warning-vcom-1246/249 "2021-12-13T09:55:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![khennigs](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@khennigs](https://forum.uvvm.org/u/khennigs)\
**Post date:** [December 13, 2021, 9:55am UTC](https://forum.uvvm.org/t/rand-pkg-vhd-causes-range-1-to-0-is-null-warning-vcom-1246/249/1 "2021-12-13T09:55:22Z")

</div>

Good Morning,

i just updated our project UVVM-Folder to **v2 2021.10.22** (c2af620)  
and found **rand\_pkg.vhd** causes some " Range 1 to 0 is null" Warnings (vcom-1246) in Modelsim.

Cause are the lines 1531…1529 and 6338…6368, because the frist index A is higher then the second B  
inside the slv(A to B).

Fixed by : slv(1 **to** 0) → slv(1 **downto** 0)

Ord did i misunderstand something?

Hoping i could help / give back something. I am still / just at the beginng ob UVVM usage.

By the way: Would you prefer an Isse at github or a message here in the forum, even if one my not be absolutely shure thats something is a bug?

Kind regards,  
Kai Hennigs

---

<div class="post-metadata">

**Author:** ![Erick](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@Erick](https://forum.uvvm.org/u/Erick)\
**Post date:** [December 13, 2021, 5:48pm UTC](https://forum.uvvm.org/t/rand-pkg-vhd-causes-range-1-to-0-is-null-warning-vcom-1246/249/2 "2021-12-13T17:48:00Z")

</div>

Hi,

These warnings are expected because the arrays need to be initialized to null elements, therefore we use the notation (1 to 0). This is a legal way of initializing a null array even though simulators might report this as a warning. If you want to avoid those warnings you can use the compile directive “-suppress 1246” when compiling the file **rand\_pkg.vhd**.

I think you can use the forum for questions or things that are not completely sure is a bug and might need a discussion. For more concrete bugs you can use Github.

Regards,  
Erick

---

<div class="post-metadata">

**Author:** ![khennigs](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@khennigs](https://forum.uvvm.org/u/khennigs)\
**Post date:** [December 17, 2021, 5:09am UTC](https://forum.uvvm.org/t/rand-pkg-vhd-causes-range-1-to-0-is-null-warning-vcom-1246/249/3 "2021-12-17T05:09:58Z")

</div>

Hi Erik!

Thanks for the quick answer! Now I can suppress the warning without being unsafe.

…and learned something.

Happy holidays and greetings from Germany  
Kai
