rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.75k stars 258 forks source link

Make C code more recognizably C #331

Closed XrXr closed 2 years ago

XrXr commented 2 years ago

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.