Commit dfd9250
authored
fix 1.ranges-of-variables.c (#10)
* fix range of unsigned types
* printf format fix warnings
$ gcc --std=c89 1.ranges-of-variables.c
1.ranges-of-variables.c: In function ‘main’:
1.ranges-of-variables.c:13:28: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
13 | printf("LONG_MIN: %d\n", LONG_MIN);
| ~^
| |
| int
| %ld
1.ranges-of-variables.c:32:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
32 | printf("signed long min=%d\n",-(long)((unsigned long) ~0 >> 1));
| ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int long int
| %ld1 parent 82ba2db commit dfd9250
File tree
1 file changed
+6
-6
lines changed- chapter-2-types-operators-expressions
1 file changed
+6
-6
lines changedLines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
0 commit comments