Commit 5ad8004
authored
Add strict prototypes for functions with no arguments. (#295)
Using compile flags `-Werror -Wstrict-prototypes` (with Clang at least),
the "prototypes" of some functions are flagged as an error. This is
because of the difference between:
```
int no_args_please(void);
```
and
```
int no_args_please();
```
Where the former is a strict prototype that says "no arguments are
allowed". With the compile flags mentioned, ReadStat fails to
compile with error messages like this:
```
In file included from src/readstat_bits.c:9:
src/readstat_bits.h:10:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
int machine_is_little_endian();
```
This PR adds the missing `void` in a handful of places where Clang
complains about it with those strict compile flags.1 parent 6bb297c commit 5ad8004
4 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
0 commit comments