Fix all the issues lint is too dumb to warn about and re-enable -Wconstant-conversion.diff -r1.10 -r1.11 src/lib/libc/Makefile.inc
(joerg)
--- src/lib/libc/Makefile.inc 2012/03/13 22:12:40 1.10
+++ src/lib/libc/Makefile.inc 2012/03/13 22:37:51 1.11
@@ -1,41 +1,40 @@ | @@ -1,41 +1,40 @@ | |||
1 | # $NetBSD: Makefile.inc,v 1.10 2012/03/13 22:12:40 joerg Exp $ | 1 | # $NetBSD: Makefile.inc,v 1.11 2012/03/13 22:37:51 joerg Exp $ | |
2 | # @(#)Makefile 8.2 (Berkeley) 2/3/94 | 2 | # @(#)Makefile 8.2 (Berkeley) 2/3/94 | |
3 | # | 3 | # | |
4 | # All library objects contain sccsid strings by default; they may be | 4 | # All library objects contain sccsid strings by default; they may be | |
5 | # excluded as a space-saving measure. To produce a library that does | 5 | # excluded as a space-saving measure. To produce a library that does | |
6 | # not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS | 6 | # not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS | |
7 | # from CPPFLAGS below. To remove these strings from just the system call | 7 | # from CPPFLAGS below. To remove these strings from just the system call | |
8 | # stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS. | 8 | # stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS. | |
9 | # | 9 | # | |
10 | # The NLS (message catalog) functions are always in libc. To choose that | 10 | # The NLS (message catalog) functions are always in libc. To choose that | |
11 | # strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS | 11 | # strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS | |
12 | # functions, put -DNLS on the CPPFLAGS line below. | 12 | # functions, put -DNLS on the CPPFLAGS line below. | |
13 | # | 13 | # | |
14 | # The YP functions are always in libc. To choose that getpwent() and friends | 14 | # The YP functions are always in libc. To choose that getpwent() and friends | |
15 | # actually call the YP functions, put -DYP on the CPPFLAGS line below. | 15 | # actually call the YP functions, put -DYP on the CPPFLAGS line below. | |
16 | # | 16 | # | |
17 | # The Hesiod functions are always in libc. To choose that getpwent() and friends | 17 | # The Hesiod functions are always in libc. To choose that getpwent() and friends | |
18 | # actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below. | 18 | # actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below. | |
19 | 19 | |||
20 | USE_FORT?= yes | 20 | USE_FORT?= yes | |
21 | 21 | |||
22 | USE_SHLIBDIR= yes | 22 | USE_SHLIBDIR= yes | |
23 | 23 | |||
24 | .include <bsd.own.mk> | 24 | .include <bsd.own.mk> | |
25 | 25 | |||
26 | WARNS=4 | 26 | WARNS=4 | |
27 | CPPFLAGS+= -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT -D_DIAGNOSTIC | 27 | CPPFLAGS+= -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT -D_DIAGNOSTIC | |
28 | CWARNFLAGS+= -Wno-constant-conversion | |||
29 | 28 | |||
30 | .if (${USE_HESIOD} != "no") | 29 | .if (${USE_HESIOD} != "no") | |
31 | CPPFLAGS+= -DHESIOD | 30 | CPPFLAGS+= -DHESIOD | |
32 | .endif | 31 | .endif | |
33 | 32 | |||
34 | .if (${USE_INET6} != "no") | 33 | .if (${USE_INET6} != "no") | |
35 | CPPFLAGS+= -DINET6 | 34 | CPPFLAGS+= -DINET6 | |
36 | .endif | 35 | .endif | |
37 | 36 | |||
38 | CPPFLAGS+= -DNLS | 37 | CPPFLAGS+= -DNLS | |
39 | 38 | |||
40 | .if (${USE_YP} != "no") | 39 | .if (${USE_YP} != "no") | |
41 | CPPFLAGS+= -DYP | 40 | CPPFLAGS+= -DYP |
--- src/lib/libc/compat/gen/compat___fts13.c 2012/03/13 21:13:31 1.7
+++ src/lib/libc/compat/gen/compat___fts13.c 2012/03/13 22:37:51 1.8
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: compat___fts13.c,v 1.7 2012/03/13 21:13:31 christos Exp $ */ | 1 | /* $NetBSD: compat___fts13.c,v 1.8 2012/03/13 22:37:51 joerg Exp $ */ | |
2 | 2 | |||
3 | #include "namespace.h" | 3 | #include "namespace.h" | |
4 | #include <sys/cdefs.h> | 4 | #include <sys/cdefs.h> | |
5 | #include <dirent.h> | 5 | #include <dirent.h> | |
6 | 6 | |||
7 | #define __LIBC12_SOURCE__ | 7 | #define __LIBC12_SOURCE__ | |
8 | 8 | |||
9 | __warn_references(__fts_children13, | 9 | __warn_references(__fts_children13, | |
10 | "warning: reference to compatibility __fts_children13();" | 10 | "warning: reference to compatibility __fts_children13();" | |
11 | " include <fts.h> for correct reference") | 11 | " include <fts.h> for correct reference") | |
12 | __warn_references(__fts_close13, | 12 | __warn_references(__fts_close13, | |
13 | "warning: reference to compatibility __fts_close13();" | 13 | "warning: reference to compatibility __fts_close13();" | |
14 | " include <fts.h> for correct reference") | 14 | " include <fts.h> for correct reference") | |
@@ -23,30 +23,32 @@ __warn_references(__fts_set13, | @@ -23,30 +23,32 @@ __warn_references(__fts_set13, | |||
23 | " include <fts.h> for correct reference") | 23 | " include <fts.h> for correct reference") | |
24 | 24 | |||
25 | #include <sys/stat.h> | 25 | #include <sys/stat.h> | |
26 | #include <compat/sys/time.h> | 26 | #include <compat/sys/time.h> | |
27 | #include <compat/sys/stat.h> | 27 | #include <compat/sys/stat.h> | |
28 | 28 | |||
29 | #define __fts_stat_t struct stat13 | 29 | #define __fts_stat_t struct stat13 | |
30 | #define __fts_ino_t u_int32_t | 30 | #define __fts_ino_t u_int32_t | |
31 | #define __fts_length_t u_short | 31 | #define __fts_length_t u_short | |
32 | #define __fts_number_t long | 32 | #define __fts_number_t long | |
33 | #define __fts_dev_t uint32_t | 33 | #define __fts_dev_t uint32_t | |
34 | #define __fts_level_t short | 34 | #define __fts_level_t short | |
35 | 35 | |||
36 | #ifndef fts_namelen_truncate | 36 | #undef fts_namelen_truncate | |
37 | #define fts_namelen_truncate(a) \ | 37 | #define fts_namelen_truncate(a) \ | |
38 | ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a)) | 38 | ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a)) | |
39 | #endif | 39 | #undef fts_pathlen_truncate | |
40 | #define ftsent_pathlen_truncate(a) \ | |||
41 | ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a)) | |||
40 | 42 | |||
41 | #define stat __stat13 | 43 | #define stat __stat13 | |
42 | #define lstat __lstat13 | 44 | #define lstat __lstat13 | |
43 | #define fstat __fstat13 | 45 | #define fstat __fstat13 | |
44 | 46 | |||
45 | #undef fts_children | 47 | #undef fts_children | |
46 | #define fts_children __fts_children13 | 48 | #define fts_children __fts_children13 | |
47 | #undef fts_close | 49 | #undef fts_close | |
48 | #define fts_close __fts_close13 | 50 | #define fts_close __fts_close13 | |
49 | #undef fts_open | 51 | #undef fts_open | |
50 | #define fts_open __fts_open13 | 52 | #define fts_open __fts_open13 | |
51 | #undef fts_read | 53 | #undef fts_read | |
52 | #define fts_read __fts_read13 | 54 | #define fts_read __fts_read13 |
--- src/lib/libc/compat/gen/compat___fts30.c 2012/03/13 21:13:31 1.4
+++ src/lib/libc/compat/gen/compat___fts30.c 2012/03/13 22:37:51 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: compat___fts30.c,v 1.4 2012/03/13 21:13:31 christos Exp $ */ | 1 | /* $NetBSD: compat___fts30.c,v 1.5 2012/03/13 22:37:51 joerg Exp $ */ | |
2 | 2 | |||
3 | #include "namespace.h" | 3 | #include "namespace.h" | |
4 | #include <sys/cdefs.h> | 4 | #include <sys/cdefs.h> | |
5 | #include <dirent.h> | 5 | #include <dirent.h> | |
6 | 6 | |||
7 | #define __LIBC12_SOURCE__ | 7 | #define __LIBC12_SOURCE__ | |
8 | 8 | |||
9 | __warn_references(__fts_children30, | 9 | __warn_references(__fts_children30, | |
10 | "warning: reference to compatibility __fts_children30();" | 10 | "warning: reference to compatibility __fts_children30();" | |
11 | " include <fts.h> for correct reference") | 11 | " include <fts.h> for correct reference") | |
12 | __warn_references(__fts_close30, | 12 | __warn_references(__fts_close30, | |
13 | "warning: reference to compatibility __fts_close30();" | 13 | "warning: reference to compatibility __fts_close30();" | |
14 | " include <fts.h> for correct reference") | 14 | " include <fts.h> for correct reference") | |
@@ -30,26 +30,29 @@ __warn_references(__fts_set30, | @@ -30,26 +30,29 @@ __warn_references(__fts_set30, | |||
30 | #define __fts_length_t u_short | 30 | #define __fts_length_t u_short | |
31 | #define __fts_number_t long | 31 | #define __fts_number_t long | |
32 | #define __fts_dev_t uint32_t | 32 | #define __fts_dev_t uint32_t | |
33 | #define __fts_level_t short | 33 | #define __fts_level_t short | |
34 | 34 | |||
35 | #define stat __stat30 | 35 | #define stat __stat30 | |
36 | #define lstat __lstat30 | 36 | #define lstat __lstat30 | |
37 | #define fstat __fstat30 | 37 | #define fstat __fstat30 | |
38 | 38 | |||
39 | #ifndef fts_namelen_truncate | 39 | #ifndef fts_namelen_truncate | |
40 | #define fts_namelen_truncate(a) \ | 40 | #define fts_namelen_truncate(a) \ | |
41 | ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a)) | 41 | ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a)) | |
42 | #endif | 42 | #endif | |
43 | #undef fts_pathlen_truncate | |||
44 | #define ftsent_pathlen_truncate(a) \ | |||
45 | ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a)) | |||
43 | 46 | |||
44 | #undef fts_children | 47 | #undef fts_children | |
45 | #define fts_children __fts_children30 | 48 | #define fts_children __fts_children30 | |
46 | #undef fts_close | 49 | #undef fts_close | |
47 | #define fts_close __fts_close30 | 50 | #define fts_close __fts_close30 | |
48 | #undef fts_open | 51 | #undef fts_open | |
49 | #define fts_open __fts_open30 | 52 | #define fts_open __fts_open30 | |
50 | #undef fts_read | 53 | #undef fts_read | |
51 | #define fts_read __fts_read30 | 54 | #define fts_read __fts_read30 | |
52 | #undef fts_set | 55 | #undef fts_set | |
53 | #define fts_set __fts_set30 | 56 | #define fts_set __fts_set30 | |
54 | 57 | |||
55 | #include <fts.h> | 58 | #include <fts.h> |
--- src/lib/libc/compat/gen/compat_fts.c 2009/10/19 17:52:05 1.4
+++ src/lib/libc/compat/gen/compat_fts.c 2012/03/13 22:37:51 1.5
@@ -1,37 +1,44 @@ | @@ -1,37 +1,44 @@ | |||
1 | /* $NetBSD: compat_fts.c,v 1.4 2009/10/19 17:52:05 christos Exp $ */ | 1 | /* $NetBSD: compat_fts.c,v 1.5 2012/03/13 22:37:51 joerg Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Written by Jason R. Thorpe <thorpej@NetBSD.org>, October 21, 1997. | 4 | * Written by Jason R. Thorpe <thorpej@NetBSD.org>, October 21, 1997. | |
5 | * Public domain. | 5 | * Public domain. | |
6 | */ | 6 | */ | |
7 | 7 | |||
8 | #include "namespace.h" | 8 | #include "namespace.h" | |
9 | #include <sys/cdefs.h> | 9 | #include <sys/cdefs.h> | |
10 | #include <dirent.h> | 10 | #include <dirent.h> | |
11 | 11 | |||
12 | #define __LIBC12_SOURCE__ | 12 | #define __LIBC12_SOURCE__ | |
13 | #include <sys/stat.h> | 13 | #include <sys/stat.h> | |
14 | #include <compat/sys/time.h> | 14 | #include <compat/sys/time.h> | |
15 | #include <compat/sys/stat.h> | 15 | #include <compat/sys/stat.h> | |
16 | 16 | |||
17 | #define __fts_stat_t struct stat12 | 17 | #define __fts_stat_t struct stat12 | |
18 | #define __fts_nlink_t u_int16_t | 18 | #define __fts_nlink_t u_int16_t | |
19 | #define __fts_ino_t u_int32_t | 19 | #define __fts_ino_t u_int32_t | |
20 | #define __fts_length_t unsigned short | 20 | #define __fts_length_t unsigned short | |
21 | #define __fts_number_t long | 21 | #define __fts_number_t long | |
22 | #define __fts_dev_t uint32_t | 22 | #define __fts_dev_t uint32_t | |
23 | #define __fts_level_t short | 23 | #define __fts_level_t short | |
24 | 24 | |||
25 | #undef fts_namelen_truncate | |||
26 | #define fts_namelen_truncate(a) \ | |||
27 | ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a)) | |||
28 | #undef fts_pathlen_truncate | |||
29 | #define ftsent_pathlen_truncate(a) \ | |||
30 | ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a)) | |||
31 | ||||
25 | #include <fts.h> | 32 | #include <fts.h> | |
26 | #include <compat/include/fts.h> | 33 | #include <compat/include/fts.h> | |
27 | 34 | |||
28 | #ifdef __weak_alias | 35 | #ifdef __weak_alias | |
29 | __weak_alias(fts_children,_fts_children) | 36 | __weak_alias(fts_children,_fts_children) | |
30 | __weak_alias(fts_close,_fts_close) | 37 | __weak_alias(fts_close,_fts_close) | |
31 | __weak_alias(fts_open,_fts_open) | 38 | __weak_alias(fts_open,_fts_open) | |
32 | __weak_alias(fts_read,_fts_read) | 39 | __weak_alias(fts_read,_fts_read) | |
33 | __weak_alias(fts_set,_fts_set) | 40 | __weak_alias(fts_set,_fts_set) | |
34 | #endif /* __weak_alias */ | 41 | #endif /* __weak_alias */ | |
35 | 42 | |||
36 | __warn_references(fts_children, | 43 | __warn_references(fts_children, | |
37 | "warning: reference to compatibility fts_children();" | 44 | "warning: reference to compatibility fts_children();" |