I am using SystemVerilog. My code is:
function write_pixel_data(datastr ds);
/* some stuff here... but no return */
endfunction
then i am calling my function like:
write_pixel_data(someval);
And i get the vcs warning:
Warning-[SV-NFIVC] Non-void function used in void context.
But i am not returning anything, i know i can cast the function call to void to get rid of the warning. But why it gives this warning??!!
Thanks.
If you haven’t declared the function as
voidand you call it without assigning the return value to anything, you’ll see this error. Simple fix:Careful though, you can’t do anything that ‘takes time’ in a function. You’ll need a
taskfor that.