From: Todd C. Miller Date: Thu, 27 Jan 2005 15:42:30 +0000 (+0000) Subject: Add __unused to rcsids X-Git-Tag: SUDO_1_7_0~733 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b8b88407f6f985455d11dbbb10fb98439ef2126;p=sudo Add __unused to rcsids --- diff --git a/alias.c b/alias.c index da6895cf9..b69c0bd98 100644 --- a/alias.c +++ b/alias.c @@ -49,7 +49,7 @@ #include "redblack.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/alloc.c b/alloc.c index 4697d9245..8b2b6dc56 100644 --- a/alloc.c +++ b/alloc.c @@ -45,7 +45,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/auth/afs.c b/auth/afs.c index 7a98ff6df..3e329ae3a 100644 --- a/auth/afs.c +++ b/auth/afs.c @@ -51,7 +51,7 @@ #include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ int diff --git a/auth/aix_auth.c b/auth/aix_auth.c index 8afe4e48b..b5e34c03a 100644 --- a/auth/aix_auth.c +++ b/auth/aix_auth.c @@ -47,7 +47,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ int diff --git a/auth/bsdauth.c b/auth/bsdauth.c index 3bc32175e..3ebdcffcf 100644 --- a/auth/bsdauth.c +++ b/auth/bsdauth.c @@ -52,7 +52,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ extern char *login_style; /* from sudo.c */ diff --git a/auth/dce.c b/auth/dce.c index 7f4db3d9e..bf76c4eaf 100644 --- a/auth/dce.c +++ b/auth/dce.c @@ -66,7 +66,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ static int check_dce_status __P((error_status_t, char *)); diff --git a/auth/fwtk.c b/auth/fwtk.c index e9740d6fc..9a7c4854e 100644 --- a/auth/fwtk.c +++ b/auth/fwtk.c @@ -50,7 +50,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ int diff --git a/auth/kerb4.c b/auth/kerb4.c index f1b51994a..b3c9e3b34 100644 --- a/auth/kerb4.c +++ b/auth/kerb4.c @@ -48,7 +48,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ int diff --git a/auth/kerb5.c b/auth/kerb5.c index d1e9cd4a8..1518858f4 100644 --- a/auth/kerb5.c +++ b/auth/kerb5.c @@ -51,7 +51,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ #ifdef HAVE_HEIMDAL diff --git a/auth/pam.c b/auth/pam.c index ca2995616..c5d20800c 100644 --- a/auth/pam.c +++ b/auth/pam.c @@ -63,7 +63,7 @@ #endif #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ static int sudo_conv __P((int, PAM_CONST struct pam_message **, diff --git a/auth/passwd.c b/auth/passwd.c index 1eeb6f23c..1dd73db93 100644 --- a/auth/passwd.c +++ b/auth/passwd.c @@ -47,7 +47,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ #define DESLEN 13 diff --git a/auth/rfc1938.c b/auth/rfc1938.c index 19d815b96..95bebbf4d 100644 --- a/auth/rfc1938.c +++ b/auth/rfc1938.c @@ -64,7 +64,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ int diff --git a/auth/secureware.c b/auth/secureware.c index bbfaa7fbf..ea32e7a05 100644 --- a/auth/secureware.c +++ b/auth/secureware.c @@ -54,7 +54,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ int diff --git a/auth/securid.c b/auth/securid.c index 134e688d9..e80c682b5 100644 --- a/auth/securid.c +++ b/auth/securid.c @@ -54,7 +54,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ union config_record configure; diff --git a/auth/securid5.c b/auth/securid5.c index 5a2f40ea5..3e3074880 100644 --- a/auth/securid5.c +++ b/auth/securid5.c @@ -56,7 +56,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/auth/sia.c b/auth/sia.c index 356bcb7fc..21e7adfd8 100644 --- a/auth/sia.c +++ b/auth/sia.c @@ -50,7 +50,7 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ static int sudo_collect __P((int, int, uchar_t *, int, prompt_t *)); diff --git a/auth/sudo_auth.c b/auth/sudo_auth.c index f9173cc3f..d51072a61 100644 --- a/auth/sudo_auth.c +++ b/auth/sudo_auth.c @@ -53,7 +53,7 @@ #include "insults.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ sudo_auth auth_switch[] = { diff --git a/check.c b/check.c index 81f754bb0..46d0428ab 100644 --- a/check.c +++ b/check.c @@ -55,7 +55,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* Status codes for timestamp_status() */ diff --git a/closefrom.c b/closefrom.c index 70336acd4..32a065381 100644 --- a/closefrom.c +++ b/closefrom.c @@ -48,7 +48,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/compat.h b/compat.h index c4eaeee05..0d1b1e068 100644 --- a/compat.h +++ b/compat.h @@ -38,7 +38,12 @@ /* Define away __attribute__ for non-gcc or old gcc */ #if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5 -#define __attribute__(x) +# define __attribute__(x) +#endif + +/* For silencing gcc warnings about rcsids */ +#ifndef __unused +# define __unused __attribute__((__unused__)) #endif /* diff --git a/defaults.c b/defaults.c index 1b50c52fb..30e0eb78d 100644 --- a/defaults.c +++ b/defaults.c @@ -49,7 +49,7 @@ #include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/env.c b/env.c index 40286b918..98bd3d34a 100644 --- a/env.c +++ b/env.c @@ -47,7 +47,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/error.c b/error.c index e25fecc52..3893e7c8b 100644 --- a/error.c +++ b/error.c @@ -24,7 +24,7 @@ #include "error.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ static void _warning __P((int, const char *, va_list)); diff --git a/fileops.c b/fileops.c index 7f7bc2d49..8a1c12fcd 100644 --- a/fileops.c +++ b/fileops.c @@ -38,7 +38,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/find_path.c b/find_path.c index 7ec916dd5..e6a6f502f 100644 --- a/find_path.c +++ b/find_path.c @@ -46,7 +46,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/fnmatch.c b/fnmatch.c index cbf4fd25b..3c2e02d7f 100644 --- a/fnmatch.c +++ b/fnmatch.c @@ -30,10 +30,6 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fnmatch.c,v 1.6 1998/03/19 00:29:59 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ - /* * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. * Compares a filename or pathname to a pattern. @@ -61,6 +57,10 @@ static char rcsid[] = "$OpenBSD: fnmatch.c,v 1.6 1998/03/19 00:29:59 millert Exp #define RANGE_NOMATCH 0 #define RANGE_ERROR (-1) +#if defined(LIBC_SCCS) && !defined(lint) +__unused static const char rcsid[] = "$OpenBSD: fnmatch.c,v 1.6 1998/03/19 00:29:59 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + static int rangematch __P((const char *, char, int, char **)); int diff --git a/getcwd.c b/getcwd.c index da3c2c023..a32bc47b5 100644 --- a/getcwd.c +++ b/getcwd.c @@ -79,7 +79,7 @@ (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ char * diff --git a/getprogname.c b/getprogname.c index eff79fdcc..1cebf84e1 100644 --- a/getprogname.c +++ b/getprogname.c @@ -22,9 +22,10 @@ #include #include +#include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ const char * diff --git a/getspwuid.c b/getspwuid.c index 8002e7bdc..afc3e311f 100644 --- a/getspwuid.c +++ b/getspwuid.c @@ -71,7 +71,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/gettime.c b/gettime.c index 3ec982f19..798ce3f1d 100644 --- a/gettime.c +++ b/gettime.c @@ -25,7 +25,7 @@ #include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/goodpath.c b/goodpath.c index af8c55479..2ee81abc9 100644 --- a/goodpath.c +++ b/goodpath.c @@ -40,7 +40,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/gram.c b/gram.c index 94bd7b705..3788ec883 100644 --- a/gram.c +++ b/gram.c @@ -70,7 +70,7 @@ static char yyrcsid[] #include "parse.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/gram.y b/gram.y index 3ce6a48e5..a12ee03c3 100644 --- a/gram.y +++ b/gram.y @@ -52,7 +52,7 @@ #include "parse.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/interfaces.c b/interfaces.c index d009eef3f..4905a7b6f 100644 --- a/interfaces.c +++ b/interfaces.c @@ -83,7 +83,7 @@ struct rtentry; #include "interfaces.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ diff --git a/ldap.c b/ldap.c index bee256291..7ab86a31b 100644 --- a/ldap.c +++ b/ldap.c @@ -57,7 +57,7 @@ #include "parse.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* LDAP code below */ diff --git a/logging.c b/logging.c index c2db37045..694ab6f69 100644 --- a/logging.c +++ b/logging.c @@ -56,7 +56,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ static void do_syslog __P((int, char *)); diff --git a/match.c b/match.c index 80860a0ca..d5db94b9f 100644 --- a/match.c +++ b/match.c @@ -89,7 +89,7 @@ #endif /* HAVE_EXTENDED_GLOB */ #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/mon_systrace.c b/mon_systrace.c index ddb45b2c0..e8abb3b64 100644 --- a/mon_systrace.c +++ b/mon_systrace.c @@ -45,7 +45,7 @@ #include "mon_systrace.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/parse.c b/parse.c index 9a70cd6f2..99840ba84 100644 --- a/parse.c +++ b/parse.c @@ -48,7 +48,7 @@ #include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/pwutil.c b/pwutil.c index ed9959525..01e72ef70 100644 --- a/pwutil.c +++ b/pwutil.c @@ -52,7 +52,7 @@ #include "redblack.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ #ifdef MYPW diff --git a/set_perms.c b/set_perms.c index c01c854e6..d2c32b345 100644 --- a/set_perms.c +++ b/set_perms.c @@ -52,7 +52,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ #ifdef __TANDEM diff --git a/sigaction.c b/sigaction.c index 3eb710cf8..478f621a9 100644 --- a/sigaction.c +++ b/sigaction.c @@ -24,7 +24,7 @@ #include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ int diff --git a/snprintf.c b/snprintf.c index 1735d2996..85812d4b5 100644 --- a/snprintf.c +++ b/snprintf.c @@ -76,7 +76,7 @@ #include "compat.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ static int xxxprintf __P((char **, size_t, int, const char *, va_list)); diff --git a/strcasecmp.c b/strcasecmp.c index a8bb8d8ca..785b78533 100644 --- a/strcasecmp.c +++ b/strcasecmp.c @@ -14,11 +14,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include +#include +#include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/strerror.c b/strerror.c index 6dc08f9c5..1500ceb31 100644 --- a/strerror.c +++ b/strerror.c @@ -22,9 +22,10 @@ #include #include +#include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/strlcat.c b/strlcat.c index 2127b3833..535d87b60 100644 --- a/strlcat.c +++ b/strlcat.c @@ -20,9 +20,10 @@ #include #include +#include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ diff --git a/strlcpy.c b/strlcpy.c index 06a87c207..127a81672 100644 --- a/strlcpy.c +++ b/strlcpy.c @@ -19,9 +19,10 @@ #include #include +#include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/sudo.c b/sudo.c index 6a930a2ed..67dcb53a0 100644 --- a/sudo.c +++ b/sudo.c @@ -90,7 +90,7 @@ #include "version.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/sudo_edit.c b/sudo_edit.c index d96233650..8f6bd1cbe 100644 --- a/sudo_edit.c +++ b/sudo_edit.c @@ -53,7 +53,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ extern sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp, saved_sa_chld; diff --git a/sudo_noexec.c b/sudo_noexec.c index 129ea3a77..024565e9d 100644 --- a/sudo_noexec.c +++ b/sudo_noexec.c @@ -14,12 +14,13 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include +#include +#include + #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /* diff --git a/testsudoers.c b/testsudoers.c index d51d592dd..bc6ed103d 100644 --- a/testsudoers.c +++ b/testsudoers.c @@ -70,7 +70,7 @@ #endif /* HAVE_FNMATCH */ #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ diff --git a/tgetpass.c b/tgetpass.c index 44a2f31a1..edcf7b864 100644 --- a/tgetpass.c +++ b/tgetpass.c @@ -70,7 +70,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ #ifndef TCSASOFT diff --git a/toke.c b/toke.c index caa2b656f..ccc5aea30 100644 --- a/toke.c +++ b/toke.c @@ -1040,7 +1040,7 @@ char *yytext; #include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ extern YYSTYPE yylval; diff --git a/toke.l b/toke.l index effa40e00..5055f9eeb 100644 --- a/toke.l +++ b/toke.l @@ -54,7 +54,7 @@ #include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ extern YYSTYPE yylval; diff --git a/utimes.c b/utimes.c index c0016456e..969346567 100644 --- a/utimes.c +++ b/utimes.c @@ -22,6 +22,7 @@ #endif #include +#include #ifdef HAVE_UTIME_H # include @@ -30,7 +31,7 @@ #endif #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ #ifndef HAVE_UTIMES diff --git a/visudo.c b/visudo.c index c7fab0212..21bc7cc8d 100644 --- a/visudo.c +++ b/visudo.c @@ -83,7 +83,7 @@ #include "version.h" #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ struct sudoersfile { diff --git a/zero_bytes.c b/zero_bytes.c index 0937ad382..1e190f7bd 100644 --- a/zero_bytes.c +++ b/zero_bytes.c @@ -17,9 +17,10 @@ #include #include +#include #ifndef lint -static const char rcsid[] = "$Sudo$"; +__unused static const char rcsid[] = "$Sudo$"; #endif /* lint */ /*