Skip to content

Commit edb350a

Browse files
committed
ffi: explicitly declare hello_from_rust for C99
1 parent 90993ee commit edb350a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ffi.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ We'll create a C file to call the `hello_from_rust` function and compile it by `
281281
C file should look like:
282282

283283
```c
284+
// Explicitly declare to avoid error like this:
285+
// implicit declaration of function 'hello_from_rust' is invalid in C99 ...
286+
extern void hello_from_rust();
287+
284288
int main(void) {
285289
hello_from_rust();
286290
return 0;

0 commit comments

Comments
 (0)