From edb350a3aa63e7c92ced84ee3fd76a6d65fcff73 Mon Sep 17 00:00:00 2001 From: mqy Date: Mon, 21 Feb 2022 15:52:00 +0800 Subject: [PATCH] ffi: explicitly declare hello_from_rust for C99 --- src/ffi.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ffi.md b/src/ffi.md index 9e02eee8..018f4f35 100644 --- a/src/ffi.md +++ b/src/ffi.md @@ -281,6 +281,10 @@ We'll create a C file to call the `hello_from_rust` function and compile it by ` C file should look like: ```c +// Explicitly declare to avoid error like this: +// implicit declaration of function 'hello_from_rust' is invalid in C99 ... +extern void hello_from_rust(); + int main(void) { hello_from_rust(); return 0;