From 6088a26d78219f0da2e90876d5e2c696749cf0c9 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 13 Feb 2025 01:03:36 -0800 Subject: [PATCH] Update VPI example to not have warnings --- Documentation/usage/vpi.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/usage/vpi.rst b/Documentation/usage/vpi.rst index 24cd6f8b69..75793cb685 100644 --- a/Documentation/usage/vpi.rst +++ b/Documentation/usage/vpi.rst @@ -42,7 +42,7 @@ module, is a null terminated table of function pointers. The simulator calls each of the functions in the table in order. The following simple C definition defines a sample table:: - void (*vlog_startup_routines[])() = { + void (*vlog_startup_routines[])(void) = { hello_register, 0 }; @@ -89,16 +89,18 @@ file hello.c:: static int hello_compiletf(char*user_data) { + (void)user_data; // Avoid a warning since user_data is not used. return 0; } static int hello_calltf(char*user_data) { + (void)user_data; // Avoid a warning since user_data is not used. vpi_printf("Hello, World!\n"); return 0; } - void hello_register() + void hello_register(void) { s_vpi_systf_data tf_data; @@ -111,7 +113,7 @@ file hello.c:: vpi_register_systf(&tf_data); } - void (*vlog_startup_routines[])() = { + void (*vlog_startup_routines[])(void) = { hello_register, 0 };