Make C code more recognizably C

As you may know, an empty parameter list can have [different semantics]
in C compared to a `(void)` parameter list. Also, while it's fine to
declare `main()` with an empty parameter list, it's implementation
defined as to whether it is acceptable.

Declare `main` with `(void)` so we use a standard-defined signature from
section 5.1.2.2.1 of C99.

[different semantics]: https://godbolt.org/z/fW66MsaMM
pull/331/head
Alan Wu 3 years ago
parent 66d097d3d8
commit d57566a923

@ -281,7 +281,7 @@ We'll create a C file to call the `hello_from_rust` function and compile it by `
C file should look like: C file should look like:
```c ```c
int main() { int main(void) {
hello_from_rust(); hello_from_rust();
return 0; return 0;
} }

Loading…
Cancel
Save