RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 16-May-2017 23:22:06 Branch: rpm-5_4 Handle: 2017051621220501 Modified files: (Branch: rpm-5_4) rpm/tools augtool.c chroot.c db_tool.c roto.c rpm2cpio.c rpmcache.c rpmdeps.c rpmdigest.c rpmfind.c rpmgrep.c rpmkey.c rpmmtree.c rpmrepo.c rpmwget.c semodule.c spooktool.c xiu-hash.c xiu-instantiate.c xiu-store.c Log: - splint: RIP. Summary: Revision Changes Path 2.14.4.2 +4 -5 rpm/tools/augtool.c 1.3.4.1 +0 -2 rpm/tools/chroot.c 2.5.2.1 +1 -2 rpm/tools/db_tool.c 1.1.2.10 +10 -30 rpm/tools/roto.c 2.11.2.3 +0 -2 rpm/tools/rpm2cpio.c 2.41.4.4 +2 -2 rpm/tools/rpmcache.c 2.21.6.1 +0 -13 rpm/tools/rpmdeps.c 2.18.4.8 +14 -37 rpm/tools/rpmdigest.c 2.15.2.12 +18 -30 rpm/tools/rpmfind.c 2.5.4.4 +42 -148 rpm/tools/rpmgrep.c 1.5.2.5 +0 -1 rpm/tools/rpmkey.c 2.17.2.11 +90 -269 rpm/tools/rpmmtree.c 2.32.2.6 +1 -38 rpm/tools/rpmrepo.c 1.5.4.4 +6 -40 rpm/tools/rpmwget.c 2.6.4.1 +4 -12 rpm/tools/semodule.c 2.4.4.2 +6 -14 rpm/tools/spooktool.c 2.1.4.2 +4 -11 rpm/tools/xiu-hash.c 2.2.4.1 +4 -7 rpm/tools/xiu-instantiate.c 2.2.4.2 +4 -7 rpm/tools/xiu-store.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/tools/augtool.c ============================================================================ $ cvs diff -u -r2.14.4.1 -r2.14.4.2 augtool.c --- rpm/tools/augtool.c 11 Mar 2012 15:09:11 -0000 2.14.4.1 +++ rpm/tools/augtool.c 16 May 2017 21:22:05 -0000 2.14.4.2 @@ -157,15 +157,15 @@ #if !defined(HAVE_RL_COMPLETION_MATCHES) typedef char *rl_compentry_func_t(const char *, int); -static char **rl_completion_matches(/*@unused@*/ const char *text, - /*@unused@*/ rl_compentry_func_t *func) +static char **rl_completion_matches(const char *text, + rl_compentry_func_t *func) { return NULL; } #endif static char **readline_completion(const char *text, int start, - /*@unused@*/ int end) + int end) { if (start == 0) return rl_completion_matches(text, readline_command_generator); @@ -312,7 +312,7 @@ break; case RPMRC_NOTFOUND: goto exit; - /*@notreached@*/ break; + break; default: break; } @@ -324,7 +324,6 @@ return ret; } -/*@unchecked@*/ /*@null@*/ extern const char ** _rpmaugLoadargv; static struct poptOption _optionsTable[] = { @@ . patch -p0 <<'@@ .' Index: rpm/tools/chroot.c ============================================================================ $ cvs diff -u -r1.3 -r1.3.4.1 chroot.c --- rpm/tools/chroot.c 4 Oct 2009 22:41:40 -0000 1.3 +++ rpm/tools/chroot.c 16 May 2017 21:22:05 -0000 1.3.4.1 @@ -39,7 +39,6 @@ static char * group; /* group to switch to ... */ static char * grouplist; /* group list to switch to ... */ -/*@unchecked@*/ /*@observer@*/ static struct poptOption optionsTable[] = { { "user",'u', POPT_ARG_STRING, &user, 0, N_("Set primary USER"), N_("USER") }, @@ -143,5 +142,4 @@ shell = _PATH_BSHELL; execlp(shell, shell, "-i", NULL); err(1, "%s", shell); - /*@notreached@*/ } @@ . patch -p0 <<'@@ .' Index: rpm/tools/db_tool.c ============================================================================ $ cvs diff -u -r2.5 -r2.5.2.1 db_tool.c --- rpm/tools/db_tool.c 2 Apr 2010 12:34:59 -0000 2.5 +++ rpm/tools/db_tool.c 16 May 2017 21:22:05 -0000 2.5.2.1 @@ -93,8 +93,7 @@ /* XXX db_recover needs RPM logio abstract log events registered. */ #define _HAVE_APP_DISPATCH #if defined(_HAVE_APP_DISPATCH) -extern int logio_dispatch(DB_ENV * dbenv, DBT * dbt, DB_LSN * lsn, db_recops op) - /*@*/; +extern int logio_dispatch(DB_ENV * dbenv, DBT * dbt, DB_LSN * lsn, db_recops op); static int (*_app_dispatch) (DB_ENV * dbenv, DBT * dbt, DB_LSN * lsn, db_recops op) = logio_dispatch; #endif @@ . patch -p0 <<'@@ .' Index: rpm/tools/roto.c ============================================================================ $ cvs diff -u -r1.1.2.9 -r1.1.2.10 roto.c --- rpm/tools/roto.c 29 Mar 2016 16:41:53 -0000 1.1.2.9 +++ rpm/tools/roto.c 16 May 2017 21:22:05 -0000 1.1.2.10 @@ -29,7 +29,7 @@ #define PKGPYTHONDIR PYTHONDIR "/mock" #define MOCKCONFDIR SYSCONFDIR "/mock" -typedef /*@abstract@*/ /*@refcounted@*/ struct ROTO_s * ROTO_t; +typedef struct ROTO_s * ROTO_t; #define F_ISSET(_roto, _FLAG) ((_roto)->flags & (ROTO_FLAGS_##_FLAG)) #define ROTODBG(_l) if (_roto_debug) fprintf _l @@ -205,10 +205,6 @@ const char * selinux_opts; rpmiob iob; /*!< output collector */ -#if defined(__LCLINT__) -/*@refs@*/ - int nrefs; /*!< (unused) keep splint happy */ -#endif }; #define Pd(_f) fprintf(fp, " %s:\t%d\n", #_f, roto->_f) @@ -354,7 +350,6 @@ #undef Pd -/*@unchecked@*/ int _roto_debug = -1; static const char * _roto_plugins[] = { @@ -480,7 +475,6 @@ #enabled=0\n\ "; -/*@unchecked@*/ static struct ROTO_s _roto = { .flags = ROTO_FLAGS_NONE, .version = ROTO_VERSION, @@ -587,19 +581,19 @@ switch(roto->p->fts_info) { case FTS_D: if (roto->visitD) xx = (*roto->visitD)(roto); - /*@switchbreak@*/ break; + break; case FTS_DP: if (roto->visitDP) xx = (*roto->visitDP)(roto); - /*@switchbreak@*/ break; + break; case FTS_DNR: case FTS_ERR: case FTS_NS: (void) fprintf(stderr, "%s: %s: %s\n", __progname, roto->p->fts_path, strerror(roto->p->fts_errno)); - /*@switchbreak@*/ break; + break; default: if (roto->visitF) xx = (*roto->visitF)(roto); - /*@switchbreak@*/ break; + break; } } xx = Fts_close(roto->t); @@ -3947,9 +3941,7 @@ * @param roto roto interpreter * @return NULL on last dereference */ -/*@unused@*/ /*@null@*/ -ROTO_t rotoUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ ROTO_t roto) - /*@modifies roto @*/; +ROTO_t rotoUnlink (ROTO_t roto); #define rotoUnlink(_roto) \ ((ROTO_t)rpmioUnlinkPoolItem((rpmioItem)(_roto), __FUNCTION__, __FILE__, __LINE__)) @@ -3958,9 +3950,7 @@ * @param roto roto interpreter * @return new roto interpreter reference */ -/*@unused@*/ /*@newref@*/ /*@null@*/ -ROTO_t rotoLink (/*@null@*/ ROTO_t roto) - /*@modifies roto @*/; +ROTO_t rotoLink (ROTO_t roto); #define rotoLink(_roto) \ ((ROTO_t)rpmioLinkPoolItem((rpmioItem)(_roto), __FUNCTION__, __FILE__, __LINE__)) @@ -3969,16 +3959,11 @@ * @param roto roto interpreter * @return NULL on last dereference */ -/*@null@*/ -ROTO_t rotoFree(/*@killref@*/ /*@null@*/ROTO_t roto) - /*@globals fileSystem @*/ - /*@modifies roto, fileSystem @*/; +ROTO_t rotoFree(ROTO_t roto); #define rotoFree(_roto) \ ((ROTO_t)rpmioFreePoolItem((rpmioItem)(_roto), __FUNCTION__, __FILE__, __LINE__)) static void rotoFini(void * _roto) - /*@globals fileSystem @*/ - /*@modifies *_roto, fileSystem @*/ { ROTO_t roto = (ROTO_t) _roto; @@ -3986,12 +3971,9 @@ roto->iob = NULL; } -/*@unchecked@*/ /*@only@*/ /*@null@*/ rpmioPool _rotoPool; -static ROTO_t rotoGetPool(/*@null@*/ rpmioPool pool) - /*@globals _rotoPool, fileSystem @*/ - /*@modifies pool, _rotoPool, fileSystem @*/ +static ROTO_t rotoGetPool(rpmioPool pool) { ROTO_t roto; @@ -4011,10 +3993,8 @@ * @param flags roto interpreter flags ((1<<31) == use global interpreter) * @return new roto interpreter */ -/*@newref@*/ /*@null@*/ static +static ROTO_t rotoNew(char ** av, uint32_t flags) - /*@globals fileSystem, internalState @*/ - /*@modifies fileSystem, internalState @*/ { ROTO_t roto = rotoGetPool(_rotoPool); const char * fn = (av ? av[0] : NULL); @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpm2cpio.c ============================================================================ $ cvs diff -u -r2.11.2.2 -r2.11.2.3 rpm2cpio.c --- rpm/tools/rpm2cpio.c 26 Apr 2012 17:46:51 -0000 2.11.2.2 +++ rpm/tools/rpm2cpio.c 16 May 2017 21:22:05 -0000 2.11.2.3 @@ -87,9 +87,7 @@ #endif (void) rpmtsSetVSFlags(ts, vsflags); - /*@-mustmod@*/ /* LCL: segfault */ rc = rpmReadPackageFile(ts, fdi, "rpm2cpio", &h); - /*@=mustmod@*/ (void)rpmtsFree(ts); ts = NULL; @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmcache.c ============================================================================ $ cvs diff -u -r2.41.4.3 -r2.41.4.4 rpmcache.c --- rpm/tools/rpmcache.c 11 May 2015 21:10:19 -0000 2.41.4.3 +++ rpm/tools/rpmcache.c 16 May 2017 21:22:05 -0000 2.41.4.4 @@ -113,7 +113,7 @@ nitems = 0; } -static int ftsCachePrint(/*@unused@*/ rpmts ts, FILE * fp) +static int ftsCachePrint(rpmts ts, FILE * fp) { int rc = 0; int i; @@ -463,7 +463,7 @@ * @param ts transaction set * @param argv package names to match */ -static void initGlobs(/*@unused@*/ rpmts ts, const char ** argv) +static void initGlobs(rpmts ts, const char ** argv) { char buf[BUFSIZ]; int i; @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmdeps.c ============================================================================ $ cvs diff -u -r2.21 -r2.21.6.1 rpmdeps.c --- rpm/tools/rpmdeps.c 26 Mar 2009 20:09:03 -0000 2.21 +++ rpm/tools/rpmdeps.c 16 May 2017 21:22:05 -0000 2.21.6.1 @@ -16,7 +16,6 @@ #include "debug.h" -/*@unchecked@*/ char *progname; #define RPMDEP_RPMFC 1 @@ -47,40 +46,30 @@ #define RPMDEP_RPMDSDPKGRPM 32 #define RPMDEP_RPMDSRPMDPKG 33 -/*@unchecked@*/ static int rpmdeps_mode = RPMDEP_RPMFC; -/*@unchecked@*/ static int print_provides = 1; -/*@unchecked@*/ static int print_requires = 1; -/*@unchecked@*/ static int print_closure = 0; #define _PERL_PROVIDES "/usr/bin/find /usr/lib/perl5 | /usr/lib/rpm/perl.prov" -/*@unchecked@*/ /*@observer@*/ static const char * _perl_provides = _PERL_PROVIDES; #define _PERL_REQUIRES "rpm -qa --fileclass | grep 'perl script' | sed -e 's/\t.*$//' | /usr/lib/rpm/perl.req" -/*@unchecked@*/ /*@observer@*/ static const char * _perl_requires = _PERL_REQUIRES; #define _JAVA_PROVIDES "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -P" -/*@unchecked@*/ /*@observer@*/ static const char * _java_provides = _JAVA_PROVIDES; #define _JAVA_REQUIRES "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -R" -/*@unchecked@*/ /*@observer@*/ static const char * _java_requires = _JAVA_REQUIRES; #define _LIBTOOL_PROVIDES "/usr/bin/find /usr/lib -name '*.la' | /usr/lib/rpm/libtooldeps.sh -P /" -/*@unchecked@*/ /*@observer@*/ static const char * _libtool_provides = _LIBTOOL_PROVIDES; #define _LIBTOOL_REQUIRES "rpm -qal | grep '\\.la$' | /usr/lib/rpm/libtooldeps.sh -R /" -/*@unchecked@*/ /*@observer@*/ static const char * _libtool_requires = _LIBTOOL_REQUIRES; #define _PKGCONFIG_PROVIDES "/usr/bin/find /usr/lib -name '*.pc' | /usr/lib/rpm/pkgconfigdeps.sh -P" @@ -240,12 +229,10 @@ int i; char buf[BUFSIZ]; -/*@-modobserver@*/ if ((progname = strrchr(argv[0], '/')) != NULL) progname++; else progname = argv[0]; -/*@=modobserver@*/ optCon = rpmcliInit(argc, argv, optionsTable); if (optCon == NULL) @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmdigest.c ============================================================================ $ cvs diff -u -r2.18.4.7 -r2.18.4.8 rpmdigest.c --- rpm/tools/rpmdigest.c 21 Apr 2017 02:58:44 -0000 2.18.4.7 +++ rpm/tools/rpmdigest.c 16 May 2017 21:22:05 -0000 2.18.4.8 @@ -1,5 +1,4 @@ #include "system.h" -/*@unchecked@*/ extern const char * __progname; #define _RPMIOB_INTERNAL @@ -50,7 +49,6 @@ enum dcFlags_e flags; /*!< rpmdc control bits. */ uint32_t algo; /*!< default digest algorithm. */ uint32_t dalgo; /*!< digest algorithm. */ -/*@observer@*/ /*@null@*/ const char * dalgoName; /*!< digest algorithm name. */ const char * digest; size_t digestlen; @@ -95,7 +93,6 @@ /*==============================================================*/ RPM_GNUC_PURE static uint32_t rpmdcName2Algo(const char * dname) - /*@*/ { struct poptOption * opt = rpmioDigestPoptTable; uint32_t dalgo = 0xffffffff; @@ -119,10 +116,8 @@ return dalgo; } -/*@null@*/ RPM_GNUC_PURE static const char * rpmdcAlgo2Name(uint32_t dalgo) - /*@*/ { struct poptOption * opt = rpmioDigestPoptTable; const char * dalgoName = NULL; @@ -145,8 +140,6 @@ /*==============================================================*/ static int rpmdcParseCoreutils(rpmdc dc) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies h_errno, fileSystem, internalState @*/ { int rc = -1; /* assume failure */ @@ -184,27 +177,27 @@ *se = '\0'; /* Skip blank lines */ - if (buf[0] == '\0') /*@innercontinue@*/ continue; + if (buf[0] == '\0') continue; /* Skip comment lines */ - if (buf[0] == '#') /*@innercontinue@*/ continue; + if (buf[0] == '#') continue; /* Parse "[algo:]digest [* ]path" line. */ dname = NULL; path = NULL; for (digest = se = buf; (c = (int)*se) != 0; se++) switch (c) { default: - /*@switchbreak@*/ break; + break; case ':': *se++ = '\0'; dname = digest; digest = se; - /*@switchbreak@*/ break; + break; case ' ': se[0] = '\0'; /* loop will terminate */ if (se[1] == ' ' || se[1] == '*') se[1] = '\0'; path = se + 2; - /*@switchbreak@*/ break; + break; } if (path == NULL) { fprintf(stderr, _("%s: %s line %u: No file path found.\n"), @@ -243,7 +236,6 @@ return rc; } -/*@null@*/ static const char * rpmdcPrintCoreutils(rpmdc dc, int rc) { const char *msg = (rc ? "FAILED" : "OK"); @@ -295,8 +287,6 @@ /*==============================================================*/ static int rpmdcParseZeroInstall(rpmdc dc) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies h_errno, fileSystem, internalState @*/ { int rc = 0; /* assume success */ @@ -387,7 +377,7 @@ case 'D': _dn = f + 2; continue; - /*@notreached@*/ break; + break; case 'F': case 'S': case 'X': @@ -451,7 +441,6 @@ return rc; } -/*@null@*/ static const char * rpmdcPrintZeroInstall(rpmdc dc, int rc) { char * t, * te; @@ -683,7 +672,6 @@ static int rpmdcVisitF(rpmdc dc) - /*@modifies dc @*/ { int rc = 0; int xx; @@ -703,14 +691,12 @@ static int rpmdcSortLexical(const FTSENT ** a, const FTSENT ** b) - /*@*/ { return strcmp((*a)->fts_name, (*b)->fts_name); } static int rpmdcSortDirsLast(const FTSENT ** a, const FTSENT ** b) - /*@*/ { if (S_ISDIR((*a)->fts_statp->st_mode)) { if (!S_ISDIR((*b)->fts_statp->st_mode)) @@ -760,7 +746,7 @@ /* XXX don't visit topdirs for 0install. */ if (F_ISSET(dc, 0INSTALL) && dc->p->fts_level > 0) rpmdcVisitF(dc); - /*@switchbreak@*/ break; + break; case FTS_DP: #ifdef NOTYET if (!F_ISSET(dc, NOCOMMENT) && (dc->p->fts_level > 0)) @@ -769,17 +755,17 @@ if (!F_ISSET(dc, DIRSONLY)) (void) printf("\n"); #endif - /*@switchbreak@*/ break; + break; case FTS_DNR: case FTS_ERR: case FTS_NS: (void) fprintf(stderr, "%s: %s: %s\n", __progname, dc->p->fts_path, strerror(dc->p->fts_errno)); - /*@switchbreak@*/ break; + break; default: if (!F_ISSET(dc, DIRSONLY)) rpmdcVisitF(dc); - /*@switchbreak@*/ break; + break; } } (void) Fts_close(dc->t); @@ -789,15 +775,12 @@ } static int rpmdcLoadManifests(rpmdc dc) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies dc, h_errno, fileSystem, internalState @*/ { return (dc->manifests != NULL ? (*dc->parse) (dc) : 0); } #if !defined(POPT_ARG_ARGV) static int _poptSaveString(const char ***argvp, unsigned int argInfo, const char * val) - /*@*/ { ARGV_t argv; int argc = 0; @@ -817,11 +800,9 @@ /** */ static void rpmdcArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, - const struct poptOption * opt, /*@unused@*/ const char * arg, - /*@unused@*/ void * data) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ + enum poptCallbackReason reason, + const struct poptOption * opt, const char * arg, + void * data) { /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ if (opt->arg == NULL) @@ -835,20 +816,16 @@ default: fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); poptPrintUsage(con, stderr, 0); -/*@-exitarg@*/ exit(2); -/*@=exitarg@*/ - /*@notreached@*/ break; + break; } } #endif /* POPT_ARG_ARGV */ static struct poptOption _optionsTable[] = { #if !defined(POPT_ARG_ARGV) -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmdcArgCallback, 0, NULL, NULL }, -/*@=type@*/ #endif /* POPT_ARG_ARGV */ { "0install", '0', POPT_BIT_SET, &_dc.flags, RPMDC_FLAGS_0INSTALL, @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmfind.c ============================================================================ $ cvs diff -u -r2.15.2.11 -r2.15.2.12 rpmfind.c --- rpm/tools/rpmfind.c 10 May 2017 16:59:43 -0000 2.15.2.11 +++ rpm/tools/rpmfind.c 16 May 2017 21:22:05 -0000 2.15.2.12 @@ -232,7 +232,6 @@ RPM_GNUC_PURE static mode_t getmode(const void * bbox, mode_t omode) - /*@*/ { const BITCMD *set; mode_t clrval, newmode, value; @@ -274,20 +273,20 @@ if ((set->cmd2 & CMD2_OBITS) != '\0') newmode |= value & set->bits; } - /*@switchbreak@*/ break; + break; case '+': newmode |= set->bits; - /*@switchbreak@*/ break; + break; case '-': newmode &= ~set->bits; - /*@switchbreak@*/ break; + break; case 'X': if (omode & (S_IFDIR|S_IXUSR|S_IXGRP|S_IXOTH)) newmode |= set->bits; - /*@switchbreak@*/ break; + break; case '\0': default: @@ -335,8 +334,7 @@ #define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) static BITCMD * -addcmd(/*@returned@*/ BITCMD *set, int op, int who, int oparg, unsigned mask) - /*@modifies set @*/ +addcmd(BITCMD *set, int op, int who, int oparg, unsigned mask) { switch (op) { case '=': @@ -385,8 +383,7 @@ * compacted, but it's not worth the effort. */ static void -compress_mode(/*@out@*/ BITCMD *set) - /*@modifies set @*/ +compress_mode(BITCMD *set) { BITCMD *nset; int setbits, clrbits, Xbits, op; @@ -411,7 +408,7 @@ } else if (op == (int)'X') Xbits |= nset->bits & ~setbits; else - /*@innerbreak@*/ break; + break; } if (clrbits) { set->cmd = '-'; @@ -434,12 +431,8 @@ } } -/*@-usereleased@*/ -/*@null@*/ static void * setmode(const char * p) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ { int perm, who; char op; @@ -478,9 +471,7 @@ */ if (isdigit(*p)) { perml = strtol(p, NULL, 8); -/*@-unrecog@*/ if (perml < 0 || (perml & ~(STANDARD_BITS|S_ISTXT))) -/*@=unrecog@*/ { free(saveset); return NULL; @@ -505,16 +496,16 @@ switch (*p) { case 'a': who |= STANDARD_BITS; - /*@switchbreak@*/ break; + break; case 'u': who |= S_ISUID|S_IRWXU; - /*@switchbreak@*/ break; + break; case 'g': who |= S_ISGID|S_IRWXG; - /*@switchbreak@*/ break; + break; case 'o': who |= S_IRWXO; - /*@switchbreak@*/ break; + break; default: goto getop; } @@ -532,7 +523,7 @@ switch (*p) { case 'r': perm |= S_IRUSR|S_IRGRP|S_IROTH; - /*@switchbreak@*/ break; + break; case 's': /* * If specific bits where requested and @@ -540,7 +531,7 @@ */ if (who == 0 || (who & ~S_IRWXO)) perm |= S_ISUID|S_ISGID; - /*@switchbreak@*/ break; + break; case 't': /* * If specific bits where requested and @@ -550,16 +541,16 @@ who |= S_ISTXT; perm |= S_ISTXT; } - /*@switchbreak@*/ break; + break; case 'w': perm |= S_IWUSR|S_IWGRP|S_IWOTH; - /*@switchbreak@*/ break; + break; case 'X': permXbits = (int)(S_IXUSR|S_IXGRP|S_IXOTH); - /*@switchbreak@*/ break; + break; case 'x': perm |= S_IXUSR|S_IXGRP|S_IXOTH; - /*@switchbreak@*/ break; + break; case 'u': case 'g': case 'o': @@ -579,7 +570,7 @@ permXbits = 0; } ADDCMD((int)*p, who, (int)op, (unsigned)mask); - /*@switchbreak@*/ break; + break; default: /* @@ -618,7 +609,6 @@ #endif return saveset; } -/*@=usereleased@*/ #endif /* !defined(HAVE_SETMODE) */ #endif /* !defined(HAVE_GETMODE) || !defined(HAVE_SETMODE) */ #endif /* __linux__ */ @@ -1036,10 +1026,8 @@ perms[0] = 'l'; else if (S_ISFIFO(mode)) perms[0] = 'p'; - /*@-unrecog@*/ else if (S_ISSOCK(mode)) perms[0] = 's'; - /*@=unrecog@*/ else if (S_ISCHR(mode)) perms[0] = 'c'; else if (S_ISBLK(mode)) @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmgrep.c ============================================================================ $ cvs diff -u -r2.5.4.3 -r2.5.4.4 rpmgrep.c --- rpm/tools/rpmgrep.c 7 May 2016 15:03:16 -0000 2.5.4.3 +++ rpm/tools/rpmgrep.c 16 May 2017 21:22:05 -0000 2.5.4.4 @@ -46,8 +46,6 @@ #include "debug.h" -/*@access miRE @*/ - typedef unsigned BOOL; #undef FALSE #define FALSE ((BOOL)0) @@ -72,58 +70,38 @@ * Global variables * *************************************************/ -/*@unchecked@*/ /*@only@*/ /*@null@*/ static const char *newline = NULL; -/*@unchecked@*/ /*@only@*/ /*@null@*/ static const char *color_string = NULL; -/*@unchecked@*/ /*@only@*/ /*@null@*/ static ARGV_t pattern_filenames = NULL; -/*@unchecked@*/ /*@only@*/ /*@null@*/ static const char *stdin_name = NULL; -/*@unchecked@*/ /*@only@*/ /*@null@*/ static const char *locale = NULL; -/*@unchecked@*/ /*@only@*/ /*@relnull@*/ static ARGV_t patterns = NULL; -/*@unchecked@*/ /*@only@*/ /*@relnull@*/ static miRE pattern_list = NULL; -/*@unchecked@*/ static int pattern_count = 0; -/*@unchecked@*/ /*@only@*/ /*@null@*/ static ARGV_t exclude_patterns = NULL; -/*@unchecked@*/ /*@only@*/ /*@relnull@*/ static miRE excludeMire = NULL; -/*@unchecked@*/ static int nexcludes = 0; -/*@unchecked@*/ /*@only@*/ /*@null@*/ static ARGV_t include_patterns = NULL; -/*@unchecked@*/ /*@only@*/ /*@relnull@*/ static miRE includeMire = NULL; -/*@unchecked@*/ static int nincludes = 0; -/*@unchecked@*/ static int after_context = 0; -/*@unchecked@*/ static int before_context = 0; -/*@unchecked@*/ static int both_context = 0; /** Actions for the -d option */ enum dee_e { dee_READ=1, dee_SKIP, dee_RECURSE }; -/*@unchecked@*/ static enum dee_e dee_action = dee_READ; /** Actions for the -D option */ enum DEE_e { DEE_READ=1, DEE_SKIP }; -/*@unchecked@*/ static enum DEE_e DEE_action = DEE_READ; -/*@unchecked@*/ static int error_count = 0; /** @@ -132,7 +110,6 @@ * all values greater than FN_DEFAULT. */ enum FN_e { FN_NONE, FN_DEFAULT, FN_ONLY, FN_NOMATCH_ONLY, FN_FORCE }; -/*@unchecked@*/ static enum FN_e filenames = FN_DEFAULT; #define _GFB(n) ((1U << (n)) | 0x40000000) @@ -160,19 +137,15 @@ GREP_FLAGS_CASELESS = _GFB(14), /*!< -i,--ignore-case ... */ }; -/*@unchecked@*/ static enum grepFlags_e grepFlags = GREP_FLAGS_NONE; #if defined(WITH_PCRE) -/*@unchecked@*/ static rpmMireMode grepMode = RPMMIRE_PCRE; #else static rpmMireMode grepMode = RPMMIRE_REGEX; #endif -/*@unchecked@*/ static struct rpmop_s grep_totalops; -/*@unchecked@*/ static struct rpmop_s grep_readops; /** @@ -181,31 +154,25 @@ * Note that the combination of -w and -x has the same effect as -x on its own, * so we can treat them as the same. */ -/*@unchecked@*/ /*@observer@*/ static const char *prefix[] = { "", "\\b", "^(?:", "^(?:", "\\Q", "\\b\\Q", "^(?:\\Q", "^(?:\\Q" }; -/*@unchecked@*/ /*@observer@*/ static const char *suffix[] = { "", "\\b", ")$", ")$", "\\E", "\\E\\b", "\\E)$", "\\E)$" }; /** UTF-8 tables - used only when the newline setting is "any". */ -/*@unchecked@*/ /*@observer@*/ static const unsigned utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; -/*@+charint@*/ -/*@unchecked@*/ /*@observer@*/ static const char utf8_table4[] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; -/*@=charint@*/ /************************************************* * Find end of line. @@ -219,10 +186,8 @@ * @retval *lenptr length of the eol sequence * @return pointer to the last byte of the line */ -/*@observer@*/ static const char * -end_of_line(const char *p, const char *endptr, /*@out@*/ size_t *lenptr) - /*@modifies *lenptr @*/ +end_of_line(const char *p, const char *endptr, size_t *lenptr) { switch(_mireEL) { default: /* Just in case */ @@ -234,7 +199,7 @@ } *lenptr = 0; return endptr; - /*@notreached@*/ break; + break; case EL_CR: while (p < endptr && *p != '\r') p++; @@ -244,7 +209,7 @@ } *lenptr = 0; return endptr; - /*@notreached@*/ break; + break; case EL_CRLF: for (;;) { @@ -258,7 +223,7 @@ return p + 1; } } - /*@notreached@*/ break; + break; case EL_ANYCRLF: while (p < endptr) { @@ -282,7 +247,7 @@ case 0x0a: /* LF */ *lenptr = 1; return p; - /*@notreached@*/ /*@switchbreak@*/ break; + break; case 0x0d: /* CR */ if (p < endptr && (unsigned)*p == 0x0a) { @@ -291,16 +256,16 @@ } else *lenptr = 1; return p; - /*@notreached@*/ /*@switchbreak@*/ break; + break; default: - /*@switchbreak@*/ break; + break; } } /* End of loop for ANYCRLF case */ *lenptr = 0; /* Must have hit the end */ return endptr; - /*@notreached@*/ break; + break; case EL_ANY: while (p < endptr) { @@ -326,7 +291,7 @@ case 0x0c: /* FF */ *lenptr = 1; return p; - /*@notreached@*/ /*@switchbreak@*/ break; + break; case 0x0d: /* CR */ if (p < endptr && (unsigned)*p == 0x0a) { @@ -335,29 +300,28 @@ } else *lenptr = 1; return p; - /*@notreached@*/ /*@switchbreak@*/ break; + break; case 0x85: /* NEL */ *lenptr = GF_ISSET(UTF8) ? 2 : 1; return p; - /*@notreached@*/ /*@switchbreak@*/ break; + break; case 0x2028: /* LS */ case 0x2029: /* PS */ *lenptr = 3; return p; - /*@notreached@*/ /*@switchbreak@*/ break; + break; default: - /*@switchbreak@*/ break; + break; } } /* End of loop for ANY case */ *lenptr = 0; /* Must have hit the end */ return endptr; - /*@notreached@*/ break; + break; } /* End of overall switch */ - /*@notreached@*/ } /************************************************* @@ -369,11 +333,9 @@ * @param startptr start of available data * @return pointer to the start of the previous line */ -/*@observer@*/ RPM_GNUC_PURE static const char * previous_line(const char *p, const char *startptr) - /*@*/ { switch (_mireEL) { default: /* Just in case */ @@ -381,13 +343,13 @@ p--; while (p > startptr && p[-1] != '\n') p--; return p; - /*@notreached@*/ break; + break; case EL_CR: p--; while (p > startptr && p[-1] != '\n') p--; return p; - /*@notreached@*/ break; + break; case EL_CRLF: for (;;) { @@ -395,8 +357,8 @@ while (p > startptr && p[-1] != '\n') p--; if (p <= startptr + 1 || p[-2] == '\r') return p; } - /*@notreached@*/ return p; /* But control should never get here */ - /*@notreached@*/ break; + return p; /* But control should never get here */ + break; case EL_ANY: case EL_ANYCRLF: @@ -429,10 +391,10 @@ case 0x0a: /* LF */ case 0x0d: /* CR */ return p; - /*@notreached@*/ /*@switchbreak@*/ break; + break; default: - /*@switchbreak@*/ break; + break; } } else { switch (c) { @@ -444,10 +406,10 @@ case 0x2028: /* LS */ case 0x2029: /* PS */ return p; - /*@notreached@*/ /*@switchbreak@*/ break; + break; default: - /*@switchbreak@*/ break; + break; } } @@ -455,9 +417,8 @@ } /* End of loop for ANY case */ return startptr; /* Hit start of data */ - /*@notreached@*/ break; + break; } /* End of overall switch */ - /*@notreached@*/ } /************************************************* @@ -473,9 +434,7 @@ * @param printname filename for printing (or NULL) */ static void do_after_lines(int lastmatchnumber, const char *lastmatchrestart, - const char *endptr, /*@null@*/ const char *printname) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ + const char *endptr, const char *printname) { int count = 0; while (lastmatchrestart < endptr && count++ < after_context) { @@ -509,8 +468,6 @@ */ static int pcregrep(FD_t fd, const char *printname) - /*@globals error_count, pattern_list, fileSystem @*/ - /*@modifies fd, error_count, pattern_list, fileSystem @*/ { int rc = 1; int linenumber = 1; @@ -572,14 +529,12 @@ miRE mire = pattern_list + i; int xx; -/*@-onlytrans@*/ /* Set sub-string offset array. */ xx = mireSetEOptions(mire, offsets, 99); /* XXX WATCHOUT: mireRegexec w length=0 does strlen(matchptr)! */ mrc = (length > 0 ? mireRegexec(mire, matchptr, length) : -1); -/*@=onlytrans@*/ - if (mrc >= 0) { match = TRUE; /*@innerbreak@*/ break; } + if (mrc >= 0) { match = TRUE; break; } if (mrc < -1) { /* XXX -1 == NOMATCH, otherwise error. */ fprintf(stderr, _("%s: pcre_exec() error %d while matching "), __progname, mrc); if (pattern_count > 1) fprintf(stderr, _("pattern number %d to "), i+1); @@ -601,12 +556,10 @@ if (error_count++ > 20) { fprintf(stderr, _("%s: too many errors - abandoned\n"), __progname); -/*@-exitarg@*/ exit(2); -/*@=exitarg@*/ } match = invert; /* No more matching; don't show the line again */ - /*@innerbreak@*/ break; + break; } } @@ -770,7 +723,7 @@ t = ptr; while (t < endmatch) { t = end_of_line(t, endptr, &ellength); - if (t <= endmatch) linenumber++; else /*@innerbreak@*/ break; + if (t <= endmatch) linenumber++; else break; } } endmatch = end_of_line(endmatch, endptr, &ellength); @@ -816,7 +769,7 @@ t = ptr; while (t < endmatch) { t = end_of_line(t, endptr, &ellength); - if (t <= endmatch) linenumber++; else /*@innerbreak@*/ break; + if (t <= endmatch) linenumber++; else break; } endmatch = end_of_line(endmatch, endptr, &ellength); linelength = endmatch - ptr - ellength; @@ -853,14 +806,12 @@ /* Now do the shuffle */ -/*@-modobserver@*/ /* XXX buffer <=> t aliasing */ memmove(buffer, buffer + MBUFTHIRD, 2*MBUFTHIRD); ptr -= MBUFTHIRD; bufflength = 2*MBUFTHIRD; bufflength += Fread(buffer + bufflength, 1, MBUFTHIRD, fd); endptr = buffer + bufflength; -/*@=modobserver@*/ /* Adjust any last match point */ if (lastmatchnumber > 0 && lastmatchrestart != NULL) @@ -909,7 +860,6 @@ * @return 1 if file name ends with suffix */ static int chkSuffix(const char * fn, const char * suffix) - /*@*/ { size_t flen = strlen(fn); size_t slen = strlen(suffix); @@ -931,8 +881,6 @@ */ static int grep_or_recurse(const char *pathname, BOOL dir_recurse, BOOL only_one_at_top) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies h_errno, fileSystem, internalState @*/ { struct stat sb, *st = &sb; int rc = 1; @@ -963,7 +911,7 @@ case dee_SKIP: rc = 1; goto exit; - /*@notreached@*/ break; + break; case dee_RECURSE: { char buffer[1024]; DIR *dir = Opendir(pathname); @@ -987,13 +935,11 @@ pathname, sep, dp->d_name); buffer[sizeof(buffer)-1] = '\0'; -/*@-onlytrans@*/ if (mireApply(excludeMire, nexcludes, buffer, 0, -1) >= 0) continue; if (mireApply(includeMire, nincludes, buffer, 0, +1) < 0) continue; -/*@=onlytrans@*/ xx = grep_or_recurse(buffer, dir_recurse, FALSE); if (xx > 1) rc = xx; @@ -1001,7 +947,7 @@ } xx = Closedir(dir); goto exit; - } /*@notreached@*/ break; + } break; } /* @@ -1072,9 +1018,7 @@ */ static BOOL compile_single_pattern(const char *pattern, - /*@null@*/ const char *filename, int count) - /*@globals pattern_list, pattern_count, fileSystem @*/ - /*@modifies pattern_list, pattern_count, fileSystem @*/ + const char *filename, int count) { miRE mire; char buffer[MBUFTHIRD + 16]; @@ -1090,7 +1034,6 @@ MBUFTHIRD, pattern, suffix[(int)(grepFlags & 0x7)]); mire = pattern_list + pattern_count; -/*@-onlytrans@*/ /* XXX initialize mire->{mode,tag,options,table}. */ xx = mireSetCOptions(mire, grepMode, 0, 0, _mirePCREtables); @@ -1098,7 +1041,6 @@ pattern_count++; return TRUE; } -/*@=onlytrans@*/ /* Handle compile errors */ mire->erroff -= (int)strlen(prefix[(int)(grepFlags & 0x7)]); if (mire->erroff < 0) @@ -1127,9 +1069,7 @@ * @return TRUE on success, FALSE after an error */ static BOOL -compile_pattern(const char *pattern, /*@null@*/ const char *filename, int count) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ +compile_pattern(const char *pattern, const char *filename, int count) { if (GF_ISSET(FIXED_STRINGS) != 0) { const char *eop = pattern + strlen(pattern); @@ -1153,9 +1093,7 @@ * @param files array of file names * @return 0 on success */ -static int mireLoadPatternFiles(/*@null@*/ ARGV_t files) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies h_errno, fileSystem, internalState @*/ +static int mireLoadPatternFiles(ARGV_t files) { const char *fn; int rc = -1; /* assume failure */ @@ -1192,7 +1130,7 @@ *se = '\0'; linenumber++; /* Skip blank lines */ - if (buffer[0] == '\0') /*@innercontinue@*/ continue; + if (buffer[0] == '\0') continue; if (!compile_pattern(buffer, fn, linenumber)) goto exit; } @@ -1215,11 +1153,9 @@ /** */ static void grepArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, + enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, - /*@unused@*/ void * data) - /*@globals color_string, dee_action, DEE_action, grepFlags, fileSystem @*/ - /*@modifies color_string, dee_action, DEE_action, grepFlags, fileSystem @*/ + void * data) { /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ if (opt->arg == NULL) @@ -1232,8 +1168,7 @@ else { fprintf(stderr, _("%s: Invalid value \"%s\" for -d\n"), __progname, arg); - /*@-exitarg@*/ exit(2); /*@=exitarg@*/ - /*@notreached@*/ + exit(2); } break; case 'D': @@ -1242,8 +1177,7 @@ else { fprintf(stderr, _("%s: Invalid value \"%s\" for -D\n"), __progname, arg); - /*@-exitarg@*/ exit(2); /*@=exitarg@*/ - /*@notreached@*/ + exit(2); } break; case 'C': @@ -1259,8 +1193,7 @@ } else { fprintf(stderr, _("%s: Unknown color setting \"%s\"\n"), __progname, arg); - /*@-exitarg@*/ exit(2); /*@=exitarg@*/ - /*@notreached@*/ + exit(2); } color_string = _free(color_string); if (GF_ISSET(COLOR)) { @@ -1272,31 +1205,25 @@ case 'V': #if defined(WITH_PCRE) -/*@-evalorderuncon -moduncon @*/ fprintf(stderr, _("%s %s (PCRE version %s)\n"), __progname, VERSION, pcre_version()); -/*@=evalorderuncon =moduncon @*/ #else fprintf(stderr, _("%s %s (without PCRE)\n"), __progname, VERSION); #endif exit(0); - /*@notreached@*/ break; + break; default: fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); poptPrintUsage(con, stderr, 0); - /*@-exitarg@*/ exit(2); /*@=exitarg@*/ - /*@notreached@*/ break; + exit(2); + break; } } /** */ -/*@+enumint@*/ -/*@unchecked@*/ static struct poptOption optionsTable[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, grepArgCallback, 0, NULL, NULL }, -/*@=type@*/ { "after-context", 'A', POPT_ARG_INT, &after_context, 0, N_("set number of following context lines"), N_("=number") }, @@ -1405,7 +1332,6 @@ POPT_TABLEEND }; -/*@=enumint@*/ /************************************************* * Main program. @@ -1413,20 +1339,6 @@ */ int main(int argc, char **argv) - /*@globals __assert_program_name, after_context, before_context, - color_string, dee_action, - exclude_patterns, excludeMire, grepFlags, - include_patterns, includeMire, locale, newline, - patterns, pattern_count, pattern_filenames, pattern_list, - stdin_name, - rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies __assert_program_name, after_context, before_context, - color_string, dee_action, - exclude_patterns, excludeMire, grepFlags, - include_patterns, includeMire, locale, newline, - patterns, pattern_count, pattern_filenames, pattern_list, - stdin_name, - rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ { poptContext optCon = rpmioInit(argc, argv, optionsTable); ARGV_t av = NULL; @@ -1438,9 +1350,7 @@ xx = rpmswEnter(&grep_totalops, -1); -/*@-observertrans -readonlytrans@*/ __progname = "pcregrep"; /* XXX HACK in expected name. */ -/*@=observertrans =readonlytrans@*/ if (stdin_name == NULL) @@ -1478,10 +1388,8 @@ /* Initialize global pattern options. */ /* Interpret the newline type; the default settings are Unix-like. */ -/*@-moduncon@*/ /* LCL: something fishy. */ xx = mireSetGOptions(newline, GF_ISSET(CASELESS), GF_ISSET(MULTILINE), GF_ISSET(UTF8)); -/*@=moduncon@*/ if (xx != 0) { fprintf(stderr, _("%s: Invalid newline specifier \"%s\"\n"), __progname, (newline != NULL ? newline : "lf")); @@ -1529,36 +1437,26 @@ goto errxit; /* Study the regular expressions, as we will be running them many times */ -/*@-onlytrans@*/ if (mireStudy(pattern_list, pattern_count)) goto errxit; -/*@=onlytrans@*/ /* If there are include or exclude patterns, compile them. */ -/*@-compmempass@*/ if (mireLoadPatterns(grepMode, 0, exclude_patterns, NULL, &excludeMire, &nexcludes)) { -/*@-nullptrarith@*/ miRE mire = excludeMire + (nexcludes - 1); -/*@=nullptrarith@*/ fprintf(stderr, _("%s: Error in 'exclude' regex at offset %d: %s\n"), __progname, mire->erroff, mire->errmsg); goto errxit; } -/*@=compmempass@*/ -/*@-compmempass@*/ if (mireLoadPatterns(grepMode, 0, include_patterns, NULL, &includeMire, &nincludes)) { -/*@-nullptrarith@*/ miRE mire = includeMire + (nincludes - 1); -/*@=nullptrarith@*/ fprintf(stderr, _("%s: Error in 'include' regex at offset %d: %s\n"), __progname, mire->erroff, mire->errmsg); goto errxit; } -/*@=compmempass@*/ /* If there are no further arguments, do the business on stdin and exit. */ if (i >= ac) { @@ -1583,7 +1481,6 @@ } exit: -/*@-statictrans@*/ pattern_list = mireFreeAll(pattern_list, pattern_count); patterns = argvFree(patterns); excludeMire = mireFreeAll(excludeMire, nexcludes); @@ -1593,13 +1490,10 @@ pattern_filenames = argvFree(pattern_filenames); -/*@-observertrans@*/ color_string = _free(color_string); locale = _free(locale); newline = _free(newline); stdin_name = _free(stdin_name); -/*@=observertrans@*/ -/*@=statictrans@*/ xx = rpmswExit(&grep_totalops, 0); if (_rpmsw_stats) { @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmkey.c ============================================================================ $ cvs diff -u -r1.5.2.4 -r1.5.2.5 rpmkey.c --- rpm/tools/rpmkey.c 29 Mar 2016 16:42:05 -0000 1.5.2.4 +++ rpm/tools/rpmkey.c 16 May 2017 21:22:05 -0000 1.5.2.5 @@ -1163,7 +1163,6 @@ execvp(argv[0], argv); rpmkeyError(argv[0]); - /*@notreached@*/ return -1; } @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmmtree.c ============================================================================ $ cvs diff -u -r2.17.2.10 -r2.17.2.11 rpmmtree.c --- rpm/tools/rpmmtree.c 10 May 2017 16:59:43 -0000 2.17.2.10 +++ rpm/tools/rpmmtree.c 16 May 2017 21:22:05 -0000 2.17.2.11 @@ -175,44 +175,31 @@ int sb_is_valid; /*!< are stat(2) defaults valid? */ uint32_t crc_total; unsigned lineno; -/*@null@*/ NODE * root; -/*@null@*/ ARGV_t paths; enum mtreeKeys_e keys; -/*@null@*/ ARGI_t algos; -/*@dependent@*/ /*@null@*/ FILE * spec1; -/*@dependent@*/ /*@null@*/ FILE * spec2; -/*@null@*/ const char * fullpath; -/*@null@*/ char * path; int ftsoptions; #if defined(HAVE_STRUCT_STAT_ST_FLAGS) size_t maxf; -/*@null@*/ unsigned long * f; #endif size_t maxg; -/*@null@*/ gid_t * g; size_t maxm; -/*@null@*/ mode_t * m; size_t maxu; -/*@null@*/ uid_t * u; #if defined(_RPMFI_INTERNAL) -/*@null@*/ rpmts ts; -/*@null@*/ rpmfi fi; #endif }; @@ -225,22 +212,13 @@ extern "C" { #endif -/*@null@*/ -static NODE * mtreeSpec(rpmfts fts, /*@null@*/ FILE * fp) - /*@globals fileSystem, internalState @*/ - /*@modifies fts, fp, fileSystem, internalState @*/; - -static int mtreeVSpec(rpmfts fts) - /*@globals fileSystem, internalState @*/ - /*@modifies fts, fileSystem, internalState @*/; - -static int mtreeCWalk(rpmfts fts) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies fts, fileSystem, internalState @*/; - -static int mtreeVWalk(rpmfts fts) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies fts, fileSystem, internalState @*/; +static NODE * mtreeSpec(rpmfts fts, FILE * fp); + +static int mtreeVSpec(rpmfts fts); + +static int mtreeCWalk(rpmfts fts); + +static int mtreeVWalk(rpmfts fts); #ifdef __cplusplus } @@ -248,17 +226,10 @@ /*==============================================================*/ -static void mtreeMiss(rpmfts fts, /*@null@*/ NODE * p, char * tail) - /*@globals h_errno, errno, fileSystem, internalState @*/ - /*@modifies p, tail, errno, fileSystem, internalState @*/; +static void mtreeMiss(rpmfts fts, NODE * p, char * tail); #include "debug.h" -/*@access DIR @*/ -/*@access FD_t @*/ -/*@access rpmfi @*/ -/*@access rpmts @*/ - #define MF_ISSET(_FLAG) ((mtreeFlags & ((MTREE_FLAGS_##_FLAG) & ~0x40000000)) != MTREE_FLAGS_NONE) #define KEYDEFAULT \ @@ -269,12 +240,9 @@ #define MBITS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) -/*@unchecked@*/ static struct rpmfts_s __rpmfts; -/*@unchecked@*/ static rpmfts _rpmfts = &__rpmfts; -/*@unchecked@*/ static enum mtreeFlags_e mtreeFlags = MTREE_FLAGS_NONE; /* XXX merge into _rpmfts, use mmiRE instead */ @@ -284,28 +252,19 @@ int pathname; }; -/*@unchecked@*/ static RPM_LIST_HEAD(, exclude) excludes; -/*@unchecked@*/ static struct rpmop_s dc_totalops; -/*@unchecked@*/ static struct rpmop_s dc_readops; -/*@unchecked@*/ static struct rpmop_s dc_digestops; /*==============================================================*/ -/*@exits@*/ static void mtree_error(const char *fmt, ...) -#ifdef __GNUC__ -__attribute__ ((format (printf, 1, 2))) -#endif - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/; + RPM_GNUC_PRINTF(1, 2); void mtree_error(const char *fmt, ...) @@ -322,11 +281,9 @@ (void)fprintf(stderr, _("%s: failed at line %u of the specification\n"), __progname, _rpmfts->lineno); exit(EXIT_FAILURE); - /*@notreached@*/ } typedef struct _key { -/*@observer@*/ const char *name; /* key name */ unsigned val; /* value */ #define NEEDVALUE 0xffffffff @@ -334,7 +291,6 @@ } KEY; /* NB: the following table must be sorted lexically. */ -/*@unchecked@*/ /*@observer@*/ static KEY keylist[] = { { "adler32", MTREE_KEYS_DIGEST, PGPHASHALGO_ADLER32 }, { "cksum", MTREE_KEYS_CKSUM, NEEDVALUE }, @@ -375,15 +331,12 @@ static int keycompare(const void * a, const void * b) - /*@*/ { return strcmp(((KEY *)a)->name, ((KEY *)b)->name); } static unsigned -parsekey(char *name, /*@out@*/ uint32_t *needvaluep) - /*@globals fileSystem @*/ - /*@modifies *needvaluep, fileSystem @*/ +parsekey(char *name, uint32_t *needvaluep) { KEY *k, tmp; @@ -403,9 +356,8 @@ return k->val; } -static /*@observer@*/ /*@null@*/ const char * +static const char * algo2tagname(uint32_t algo) - /*@*/ { const char * tagname = NULL; @@ -438,7 +390,6 @@ #if defined(HAVE_STRUCT_STAT_ST_FLAGS) static const char * flags_to_string(u_long fflags) - /*@*/ { char * string = fflagstostr(fflags); if (string != NULL && *string == '\0') { @@ -451,7 +402,6 @@ /*==============================================================*/ -/*@unchecked@*/ /*@observer@*/ static const uint32_t crctab[] = { 0x0, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, @@ -514,9 +464,7 @@ * success and 1 on failure. Errno is set on failure. */ static int -crc(FD_t fd, /*@out@*/ uint32_t * cval, /*@out@*/ uint32_t * clen) - /*@globals _rpmfts, fileSystem @*/ - /*@modifies fd, *clen, *cval, _rpmfts, fileSystem @*/ +crc(FD_t fd, uint32_t * cval, uint32_t * clen) { uint32_t crc = 0; uint32_t len = 0; @@ -588,20 +536,14 @@ */ #define UNVIS_END 1 /* no more characters */ -static char *vis(/*@returned@*/ /*@out@*/ char *dst, int c, int flag, int nextc) - /*@modifies dst @*/; -static int strvis(/*@out@*/ char *dst, const char *src, int flag) - /*@modifies dst @*/; +static char *vis(char *dst, int c, int flag, int nextc); +static int strvis(char *dst, const char *src, int flag); #ifdef NOTUSED -static int strnvis(/*@out@*/ char *dst, const char *src, size_t siz, int flag) - /*@modifies dst @*/; -static int strvisx(/*@out@*/ char *dst, const char *src, size_t len, int flag) - /*@modifies dst @*/; -#endif -static int strunvis(/*@out@*/ char *dst, const char *src) - /*@modifies dst @*/; -static int unvis(/*@out@*/ char *cp, char c, int *astate, int flag) - /*@modifies cp, astate @*/; +static int strnvis(char *dst, const char *src, size_t siz, int flag); +static int strvisx(char *dst, const char *src, size_t len, int flag); +#endif +static int strunvis(char *dst, const char *src); +static int unvis(char *cp, char c, int *astate, int flag); #define isoctal(c) (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7') #define isvisible(c) \ @@ -966,13 +908,13 @@ switch (unvis(dst, c, &state, 0)) { case UNVIS_VALID: dst++; - /*@switchbreak@*/ break; + break; case UNVIS_VALIDPUSH: dst++; goto again; case 0: case UNVIS_NOCHAR: - /*@switchbreak@*/ break; + break; default: return (-1); } @@ -1018,8 +960,7 @@ */ RPM_GNUC_PURE static mode_t -getmode(const void * bbox, mode_t omode) - /*@*/ +getmode(const void * bbox, mode_t omode); { const BITCMD *set; mode_t clrval, newmode, value; @@ -1061,20 +1002,20 @@ if ((set->cmd2 & CMD2_OBITS) != '\0') newmode |= value & set->bits; } - /*@switchbreak@*/ break; + break; case '+': newmode |= set->bits; - /*@switchbreak@*/ break; + break; case '-': newmode &= ~set->bits; - /*@switchbreak@*/ break; + break; case 'X': if (omode & (S_IFDIR|S_IXUSR|S_IXGRP|S_IXOTH)) newmode |= set->bits; - /*@switchbreak@*/ break; + break; case '\0': default: @@ -1122,8 +1063,7 @@ #define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) static BITCMD * -addcmd(/*@returned@*/ BITCMD *set, int op, int who, int oparg, unsigned mask) - /*@modifies set @*/ +addcmd(BITCMD *set, int op, int who, int oparg, unsigned mask) { switch (op) { case '=': @@ -1172,8 +1112,7 @@ * compacted, but it's not worth the effort. */ static void -compress_mode(/*@out@*/ BITCMD *set) - /*@modifies set @*/ +compress_mode(BITCMD *set) { BITCMD *nset; int setbits, clrbits, Xbits, op; @@ -1198,7 +1137,7 @@ } else if (op == (int)'X') Xbits |= nset->bits & ~setbits; else - /*@innerbreak@*/ break; + break; } if (clrbits) { set->cmd = '-'; @@ -1221,12 +1160,8 @@ } } -/*@-usereleased@*/ -/*@null@*/ static void * setmode(const char * p) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ { int perm, who; char op; @@ -1265,9 +1200,7 @@ */ if (isdigit(*p)) { perml = strtol(p, NULL, 8); -/*@-unrecog@*/ if (perml < 0 || (perml & ~(STANDARD_BITS|S_ISTXT))) -/*@=unrecog@*/ { free(saveset); return (NULL); @@ -1292,16 +1225,16 @@ switch (*p) { case 'a': who |= STANDARD_BITS; - /*@switchbreak@*/ break; + break; case 'u': who |= S_ISUID|S_IRWXU; - /*@switchbreak@*/ break; + break; case 'g': who |= S_ISGID|S_IRWXG; - /*@switchbreak@*/ break; + break; case 'o': who |= S_IRWXO; - /*@switchbreak@*/ break; + break; default: goto getop; } @@ -1319,7 +1252,7 @@ switch (*p) { case 'r': perm |= S_IRUSR|S_IRGRP|S_IROTH; - /*@switchbreak@*/ break; + break; case 's': /* * If specific bits where requested and @@ -1327,7 +1260,7 @@ */ if (who == 0 || (who & ~S_IRWXO)) perm |= S_ISUID|S_ISGID; - /*@switchbreak@*/ break; + break; case 't': /* * If specific bits where requested and @@ -1337,16 +1270,16 @@ who |= S_ISTXT; perm |= S_ISTXT; } - /*@switchbreak@*/ break; + break; case 'w': perm |= S_IWUSR|S_IWGRP|S_IWOTH; - /*@switchbreak@*/ break; + break; case 'X': permXbits = (int)(S_IXUSR|S_IXGRP|S_IXOTH); - /*@switchbreak@*/ break; + break; case 'x': perm |= S_IXUSR|S_IXGRP|S_IXOTH; - /*@switchbreak@*/ break; + break; case 'u': case 'g': case 'o': @@ -1366,7 +1299,7 @@ permXbits = 0; } ADDCMD((int)*p, who, (int)op, (unsigned)mask); - /*@switchbreak@*/ break; + break; default: /* @@ -1405,7 +1338,6 @@ #endif return saveset; } -/*@=usereleased@*/ #endif /* !defined(HAVE_SETMODE) */ #endif /* !defined(HAVE_GETMODE) || !defined(HAVE_SETMODE) */ #endif /* __linux__ */ @@ -1414,8 +1346,6 @@ static void set(char * t, NODE * ip) - /*@globals fileSystem, internalState @*/ - /*@modifies t, ip, fileSystem, internalState @*/ { char *kw; @@ -1433,12 +1363,12 @@ ip->cksum = strtoul(val, &ep, 10); if (*ep != '\0') mtree_error("invalid checksum %s", val); - /*@switchbreak@*/ break; + break; case MTREE_KEYS_FLAGS: #if defined(HAVE_STRUCT_STAT_ST_FLAGS) if (!strcmp(val, "none")) { ip->sb.st_flags = 0; - /*@switchbreak@*/ break; + break; } { unsigned long fset, fclr; if (strtofflags(&val, &fset, &fclr)) @@ -1446,42 +1376,40 @@ ip->sb.st_flags = fset; } #endif - /*@switchbreak@*/ break; + break; case MTREE_KEYS_GID: ip->sb.st_gid = strtoul(val, &ep, 10); if (*ep != '\0') mtree_error("invalid gid %s", val); - /*@switchbreak@*/ break; + break; case MTREE_KEYS_GNAME: if (gnameToGid(val, &ip->sb.st_gid) == -1) mtree_error("unknown group %s", val); - /*@switchbreak@*/ break; + break; case MTREE_KEYS_IGN: /* just set flag bit */ - /*@switchbreak@*/ break; + break; case MTREE_KEYS_MODE: { mode_t *m; if ((m = setmode(val)) == NULL) mtree_error("invalid file mode %s", val); ip->sb.st_mode = getmode(m, 0); free(m); - } /*@switchbreak@*/ break; + } break; case MTREE_KEYS_NLINK: ip->sb.st_nlink = strtoul(val, &ep, 10); if (*ep != '\0') mtree_error("invalid link count %s", val); - /*@switchbreak@*/ break; + break; case MTREE_KEYS_DIGEST: (void) argiAdd(&ip->algos, -1, (int)needvalue); (void) argvAdd(&ip->digests, val); - /*@switchbreak@*/ break; + break; case MTREE_KEYS_SIZE: -/*@-unrecog@*/ ip->sb.st_size = strtoul(val, &ep, 10); -/*@=unrecog@*/ if (*ep != '\0') mtree_error("invalid size %s", val); - /*@switchbreak@*/ break; + break; case MTREE_KEYS_SLINK: ip->slink = xmalloc(strlen(val) + 1); if (strunvis(ip->slink, val) == -1) { @@ -1490,7 +1418,7 @@ /* XXX Mac OS X exits here. */ strcpy(ip->slink, val); } - /*@switchbreak@*/ break; + break; case MTREE_KEYS_TIME: #if defined(TIMEVAL_TO_TIMESPEC) ip->sb.st_mtimespec.tv_sec = strtoul(val, &ep, 10); @@ -1509,48 +1437,48 @@ if (*ep != '\0') mtree_error("invalid time %s", val); #endif - /*@switchbreak@*/ break; + break; case MTREE_KEYS_TYPE: switch(*val) { case 'b': if (!strcmp(val, "block")) ip->type = F_BLOCK; - /*@innerbreak@*/ break; + break; case 'c': if (!strcmp(val, "char")) ip->type = F_CHAR; - /*@innerbreak@*/ break; + break; case 'd': if (!strcmp(val, "dir")) ip->type = F_DIR; - /*@innerbreak@*/ break; + break; case 'f': if (!strcmp(val, "file")) ip->type = F_FILE; if (!strcmp(val, "fifo")) ip->type = F_FIFO; - /*@innerbreak@*/ break; + break; case 'l': if (!strcmp(val, "link")) ip->type = F_LINK; - /*@innerbreak@*/ break; + break; case 's': if (!strcmp(val, "socket")) ip->type = F_SOCK; - /*@innerbreak@*/ break; + break; default: mtree_error("unknown file type %s", val); } - /*@switchbreak@*/ break; + break; case MTREE_KEYS_UID: ip->sb.st_uid = strtoul(val, &ep, 10); if (*ep != '\0') mtree_error("invalid uid %s", val); - /*@switchbreak@*/ break; + break; case MTREE_KEYS_UNAME: if (unameToUid(val, &ip->sb.st_uid) == -1) mtree_error("unknown user %s", val); - /*@switchbreak@*/ break; + break; case MTREE_KEYS_NONE: case MTREE_KEYS_DONE: case MTREE_KEYS_MAGIC: @@ -1558,15 +1486,13 @@ case MTREE_KEYS_NOCHANGE: case MTREE_KEYS_OPT: ip->flags &= ~type; /* XXX clean up "can't happen" cruft? */ - /*@notreached@*/ /*@switchbreak@*/ break; + break; } } } static void unset(char * t, NODE * ip) - /*@globals fileSystem, internalState @*/ - /*@modifies t, ip, fileSystem, internalState @*/ { char *p; @@ -1638,12 +1564,12 @@ switch(p[1]) { case 's': if (strcmp(p + 1, "set")) - /*@switchbreak@*/ break; + break; set(NULL, &ginfo); continue; case 'u': if (strcmp(p + 1, "unset")) - /*@switchbreak@*/ break; + break; unset(NULL, &ginfo); continue; } @@ -1704,10 +1630,8 @@ /*==============================================================*/ -/*@observer@*/ static const char * ftype(unsigned type) - /*@*/ { switch(type) { case F_BLOCK: return "block"; @@ -1719,13 +1643,10 @@ case F_SOCK: return "socket"; default: return "unknown"; } - /*@notreached@*/ } -/*@observer@*/ static const char * inotype(mode_t mode) - /*@*/ { switch(mode & S_IFMT) { case S_IFBLK: return "block"; @@ -1734,12 +1655,9 @@ case S_IFIFO: return "fifo"; case S_IFREG: return "file"; case S_IFLNK: return "link"; -/*@-unrecog@*/ case S_IFSOCK: return "socket"; -/*@=unrecog@*/ default: return "unknown"; } - /*@notreached@*/ } /*- @@ -1777,8 +1695,6 @@ static void shownode(NODE *n, enum mtreeKeys_e keys, const char *path) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ { printf("%s%s %s", path, n->name, ftype((unsigned)n->type)); if (KF_ISSET(keys, CKSUM)) @@ -1796,10 +1712,8 @@ printf(" mode=%o", (unsigned) n->sb.st_mode); if (KF_ISSET(keys, NLINK)) printf(" nlink=%lu", (unsigned long) n->sb.st_nlink); -/*@-duplicatequals@*/ if (KF_ISSET(keys, SIZE)) printf(" size=%llu", (unsigned long long)n->sb.st_size); -/*@=duplicatequals@*/ if (KF_ISSET(keys, UID)) printf(" uid=%lu", (unsigned long) n->sb.st_uid); if (KF_ISSET(keys, UNAME)) { @@ -1836,8 +1750,6 @@ static int mismatch(NODE *n1, NODE *n2, enum mtreeKeys_e differ, const char *path) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ { enum mtreeKeys_e keys = _rpmfts->keys; @@ -1861,8 +1773,6 @@ static int compare_nodes(NODE *n1, NODE *n2, const char *path) - /*@globals fileSystem @*/ - /*@modifies n1, n2, fileSystem @*/ { enum mtreeKeys_e differs = MTREE_KEYS_NONE; int xx; @@ -1902,10 +1812,8 @@ if (FS(n1, n2, MTREE_KEYS_SLINK, slink)) differs |= MTREE_KEYS_SLINK; -/*@-type@*/ if (FM(n1, n2, MTREE_KEYS_TIME, sb.st_mtimespec)) differs |= MTREE_KEYS_TIME; -/*@=type@*/ if (FF(n1, n2, MTREE_KEYS_UID, sb.st_uid)) differs |= MTREE_KEYS_UID; if (FF(n1, n2, MTREE_KEYS_UNAME, sb.st_uid)) @@ -1944,8 +1852,6 @@ static int mtreeSWalk(NODE *t1, NODE *t2, const char *path) - /*@globals fileSystem @*/ - /*@modifies t1, t2, fileSystem @*/ { NODE *c1 = (t1 != NULL ? t1->child : NULL); NODE *c2 = (t2 != NULL ? t2->child : NULL); @@ -1976,7 +1882,6 @@ } } } -/*@-noeffectuncon -unrecog@*/ if (c1 == NULL && c2->type == F_DIR) { if (asprintf(&np, "%s%s/", path, c2->name)) { perror("asprintf"); @@ -2003,7 +1908,6 @@ } else { i = compare_nodes(c1, c2, path); } -/*@=noeffectuncon =unrecog@*/ r += i; c1 = n1; c2 = n2; @@ -2025,12 +1929,8 @@ /*==============================================================*/ -/*@observer@*/ static const char * rlink(const char * name) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies fileSystem, internalState @*/ - { static char lbuf[MAXPATHLEN]; int len; @@ -2050,9 +1950,7 @@ tab = "\t"; \ } -/*@observer@*/ static const char * algo2name(uint32_t algo) - /*@*/ { switch (algo) { case PGPHASHALGO_MD5: return "MD5"; @@ -2079,14 +1977,10 @@ default: return "Unknown"; } - /*@notreached@*/ } static int compare(rpmfts fts, NODE *const s) - /*@globals errno, h_errno, fileSystem, internalState @*/ - /*@modifies errno, fileSystem, internalState @*/ - { const char * name = s->name; FTSENT *const p = fts->p; @@ -2123,13 +2017,11 @@ goto typeerr; break; case F_SOCK: -/*@-unrecog@*/ if (!S_ISSOCK(st->st_mode)) { typeerr: LABEL; (void) printf(_("\ttype expected %s found %s)\n"), ftype((unsigned)s->type), inotype(st->st_mode)); } -/*@=unrecog@*/ break; } @@ -2199,11 +2091,9 @@ } if (KF_ISSET(keys, SIZE) && s->sb.st_size != st->st_size) { LABEL; -/*@-duplicatequals@*/ (void) printf(_("%s%s expected %llu found %llu\n"), tab, "size", (unsigned long long)s->sb.st_size, (unsigned long long)st->st_size); -/*@=duplicatequals@*/ tab = "\t"; } /* @@ -2217,7 +2107,6 @@ if (KF_ISSET(keys, TIME)) { struct timeval tv[2]; -/*@-noeffectuncon -unrecog @*/ #if defined(TIMESPEC_TO_TIMEVAL) TIMESPEC_TO_TIMEVAL(&tv[0], &s->sb.st_mtimespec); TIMESPEC_TO_TIMEVAL(&tv[1], &st->st_mtimespec); @@ -2227,7 +2116,6 @@ tv[1].tv_sec = (long)st->st_mtime; tv[1].tv_usec = 0L; #endif -/*@=noeffectuncon =unrecog @*/ if (tv[0].tv_sec != tv[1].tv_sec #ifdef NOTYET /* XXX avoid timespec jitter issues for now. */ || tv[0].tv_usec != tv[1].tv_usec @@ -2363,8 +2251,6 @@ static int mtreeVisitD(rpmfts fts) - /*@globals fileSystem, internalState @*/ - /*@modifies fts, fileSystem, internalState @*/ { enum mtreeKeys_e keys = fts->keys; const FTSENT *const parent = fts->p; @@ -2503,8 +2389,6 @@ static void output(int indent, int * offset, const char * fmt, ...) - /*@globals fileSystem @*/ - /*@modifies *offset, fileSystem @*/ { char buf[1024]; va_list ap; @@ -2522,8 +2406,6 @@ static void mtreeVisitF(rpmfts fts) - /*@globals errno, h_errno, fileSystem, internalState @*/ - /*@modifies errno, fileSystem, internalState @*/ { enum mtreeKeys_e keys = fts->keys; const char * fts_accpath = fts->p->fts_accpath; @@ -2625,7 +2507,6 @@ goto cleanup; #else mtree_error("%s: %s", fts_accpath, Fstrerror(fd)); - /*@notreached@*/ #endif } @@ -2649,7 +2530,6 @@ __progname, fts_accpath, Fstrerror(fd)); #else mtree_error("%s: %s", fts_accpath, Fstrerror(fd)); - /*@notreached@*/ #endif goto cleanup; } @@ -2754,11 +2634,8 @@ * so it's OK to use a stupid algorithm. */ -/*@mayexit@*/ static void mtreeReadExcludes(const char * fn) - /*@globals excludes, h_errno, fileSystem, internalState @*/ - /*@modifies excludes, fileSystem, internalState @*/ { FD_t fd = Fopen(fn, "r.fpio"); FILE *fp; @@ -2778,43 +2655,36 @@ buffer[sizeof(buffer)-1] = '\0'; for (line = buffer; *line != '\0'; line++) - if (strchr(" \t\n\r", line[1]) == NULL) /*@innerbreak@*/ break; + if (strchr(" \t\n\r", line[1]) == NULL) break; if (*line == '\0' || *line == '#') continue; for (len = strlen(line); len > 0; len--) - if (strchr(" \t\n\r", line[len-1]) == NULL) /*@innerbreak@*/ break; + if (strchr(" \t\n\r", line[len-1]) == NULL) break; if (len == 0) continue; e = xmalloc(sizeof(*e)); e->glob = xstrdup(line); e->pathname = (strchr(line, '/') != NULL ? 1 : 0); -/*@-immediatetrans@*/ RPM_LIST_INSERT_HEAD(&excludes, e, link); -/*@=immediatetrans@*/ } if (fd != NULL) (void) Fclose(fd); -/*@-compmempass -nullstate @*/ return; -/*@=compmempass =nullstate @*/ } static int mtreeCheckExcludes(const char *fname, const char *path) - /*@*/ { struct exclude *e; /* fnmatch(3) has a funny return value convention... */ #define MATCH(g, n) (fnmatch((g), (n), FNM_PATHNAME) == 0) -/*@-predboolptr@*/ RPM_LIST_FOREACH(e, &excludes, link) { if ((e->pathname && MATCH(e->glob, path)) || MATCH(e->glob, fname)) return 1; } -/*@=predboolptr@*/ return 0; } @@ -2822,7 +2692,6 @@ static int dsort(const FTSENT ** a, const FTSENT ** b) - /*@*/ { if (S_ISDIR((*a)->fts_statp->st_mode)) { if (!S_ISDIR((*b)->fts_statp->st_mode)) @@ -2840,7 +2709,6 @@ * @return 1 if file name ends with suffix */ static int chkSuffix(const char * fn, const char * suffix) - /*@*/ { size_t flen = strlen(fn); size_t slen = strlen(suffix); @@ -2848,8 +2716,6 @@ } static int _rpmfiStat(const char * path, struct stat * st) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ { rpmfts fts = _rpmfts; rpmfi fi = _rpmfts->fi; @@ -2864,9 +2730,7 @@ return rc; } -static int _rpmfiClosedir(/*@only@*/ DIR * dir) - /*@globals fileSystem @*/ - /*@modifies dir, fileSystem @*/ +static int _rpmfiClosedir(DIR * dir) { rpmfi fi = _rpmfts->fi; @@ -2876,9 +2740,7 @@ return avClosedir(dir); } -static /*@null@*/ struct dirent * _rpmfiReaddir(DIR * dir) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ +static struct dirent * _rpmfiReaddir(DIR * dir) { rpmfi fi = _rpmfts->fi; struct dirent * dp = (struct dirent *) avReaddir(dir); @@ -2886,14 +2748,11 @@ if (_fts_debug) fprintf(stderr, "*** _rpmfiReaddir(%p) fi %p %p \"%s\"\n", dir, fi, dp, (dp != NULL ? dp->d_name : "")); -/*@-dependenttrans@*/ return dp; -/*@=dependenttrans@*/ } -static /*@null@*/ +static uint8_t * rpmfiParentDirNotWithin(rpmfi fi) - /*@*/ { size_t * dnlens = xmalloc(fi->dc * sizeof(*dnlens)); uint8_t * noparent = memset(xmalloc(fi->dc), 1, fi->dc); @@ -2915,19 +2774,19 @@ for (j = 0; j < (int)fi->dc; j++) { if (!noparent[j] || j == (int)fi->dil[i]) - /*@innercontinue@*/ continue; + continue; if (dnlens[j] != (dnlen+bnlen+1)) - /*@innercontinue@*/ continue; + continue; if (strncmp(fi->dnl[j], fi->dnl[fi->dil[i]], dnlen)) - /*@innercontinue@*/ continue; + continue; if (strncmp(fi->dnl[j]+dnlen, fi->bnl[i], bnlen)) - /*@innercontinue@*/ continue; + continue; if (fi->dnl[j][dnlen+bnlen] != '/' || fi->dnl[j][dnlen+bnlen+1] != '\0') - /*@innercontinue@*/ continue; + continue; /* This parent directory is contained within the package. */ noparent[j] = (uint8_t)0; - /*@innerbreak@*/ break; + break; } } dnlens = _free(dnlens); @@ -2935,8 +2794,6 @@ } static Header rpmftsReadHeader(rpmfts fts, const char * path) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies fts, rpmGlobalMacroContext, fileSystem, internalState @*/ { FD_t fd = Fopen(path, "r.ufdio"); Header h = NULL; @@ -2964,9 +2821,7 @@ return h; } -static /*@null@*/ rpmfi rpmftsLoadFileInfo(rpmfts fts, const char * path) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies fts, rpmGlobalMacroContext, fileSystem, internalState @*/ +static rpmfi rpmftsLoadFileInfo(rpmfts fts, const char * path) { char * fn = xstrdup(path); size_t nb = strlen(fn); @@ -2984,11 +2839,7 @@ return fts->fi; } -static /*@null@*/ DIR * _rpmfiOpendir(const char * path) - /*@globals _rpmfts, rpmGlobalMacroContext, h_errno, - fileSystem, internalState @*/ - /*@modifies _rpmfts, rpmGlobalMacroContext, - fileSystem, internalState @*/ +static DIR * _rpmfiOpendir(const char * path) { rpmfts fts = _rpmfts; DIR * dir = NULL; @@ -3037,7 +2888,6 @@ static FTSENT * fts_alloc(FTS * sp, const char * name, int namelen) - /*@*/ { register FTSENT *p; size_t len; @@ -3051,20 +2901,16 @@ * namelen + 2 before the first possible address of the stat structure. */ len = sizeof(*p) + namelen; -/*@-sizeoftype@*/ if (!(sp->fts_options & FTS_NOSTAT)) len += sizeof(*p->fts_statp) + ALIGNBYTES; -/*@=sizeoftype@*/ p = xmalloc(len); /* Copy the name and guarantee NUL termination. */ memmove(p->fts_name, name, namelen); p->fts_name[namelen] = '\0'; -/*@-sizeoftype@*/ if (!(sp->fts_options & FTS_NOSTAT)) p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2); -/*@=sizeoftype@*/ p->fts_namelen = namelen; p->fts_path = sp->fts_path; p->fts_errno = 0; @@ -3076,8 +2922,6 @@ } static void _rpmfiSetFts(rpmfts fts) - /*@globals h_errno, fileSystem, internalState @*/ - /*@modifies fts, fileSystem, internalState @*/ { char *const * argv = (char *const *) fts->paths; FTS * sp = fts->t; @@ -3093,13 +2937,11 @@ if (_fts_debug) fprintf(stderr, "*** _rpmfiSetFts(%p)\n", fts); -/*@-type@*/ sp->fts_opendir = _rpmfiOpendir; sp->fts_readdir = _rpmfiReaddir; sp->fts_closedir = _rpmfiClosedir; sp->fts_stat = _rpmfiStat; sp->fts_lstat = _rpmfiStat; -/*@=type@*/ /* Allocate/initialize root's parent. */ if (*argv != NULL) { @@ -3217,24 +3059,24 @@ (void) printf("# %s\n", fts->p->fts_path); (void) mtreeVisitD(fts); mtreeVisitF(fts); - /*@switchbreak@*/ break; + break; case FTS_DP: if (!MF_ISSET(NOCOMMENT) && (fts->p->fts_level > 0)) (void) printf("%*s# %s\n", indent, "", fts->p->fts_path); (void) printf("%*s..\n", indent, ""); if (!MF_ISSET(DIRSONLY)) (void) printf("\n"); - /*@switchbreak@*/ break; + break; case FTS_DNR: case FTS_ERR: case FTS_NS: (void) fprintf(stderr, "%s: %s: %s\n", __progname, fts->p->fts_path, strerror(fts->p->fts_errno)); - /*@switchbreak@*/ break; + break; default: if (!MF_ISSET(DIRSONLY)) mtreeVisitF(fts); - /*@switchbreak@*/ break; + break; } } (void) Fts_close(fts->t); @@ -3246,7 +3088,7 @@ /*==============================================================*/ void -mtreeMiss(rpmfts fts, /*@null@*/ NODE * p, char * tail) +mtreeMiss(rpmfts fts, NODE * p, char * tail) { int create; char *tp; @@ -3406,7 +3248,7 @@ level = root = root->next; assert(level == level->parent); } - /*@switchbreak@*/ break; + break; case FTS_DP: if (specdepth > fts->p->fts_level) { for (level = level->parent; level->prev != NULL; level = level->prev); @@ -3429,9 +3271,7 @@ NODE *ep; for (ep = level; ep != NULL; ep = ep->next) if ((KF_ISSET(ep->flags, MAGIC) && -/*@-moduncon@*/ !fnmatch(ep->name, fts_name, FNM_PATHNAME)) || -/*@=moduncon@*/ !strcmp(ep->name, fts_name)) { ep->flags |= MTREE_KEYS_VISIT; @@ -3446,7 +3286,7 @@ level = ep->child; ++specdepth; } - /*@innerbreak@*/ break; + break; } if (ep != NULL) continue; @@ -3476,11 +3316,9 @@ /** */ static void mtreeArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, + enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, - /*@unused@*/ void * data) - /*@globals _rpmfts, rpmioFtsOpts, h_errno, fileSystem, internalState @*/ - /*@modifies _rpmfts, rpmioFtsOpts, fileSystem, internalState @*/ + void * data) { char * p; @@ -3499,7 +3337,6 @@ /* XXX error message, too many -f options. */ poptPrintUsage(con, stderr, 0); exit(EXIT_FAILURE); - /*@notreached@*/ } break; case 'k': @@ -3507,7 +3344,6 @@ _rpmfts->keys = MTREE_KEYS_TYPE; /*@fallthrough@*/ case 'K': -/*@-unrecog@*/ while ((p = strsep((char **)&arg, " \t,")) != NULL) { uint32_t needvalue; enum mtreeKeys_e type = parsekey(p, &needvalue); @@ -3520,7 +3356,6 @@ if (KF_ISSET(_rpmfts->keys, DIGEST) && needvalue) (void) argiAdd(&_rpmfts->algos, -1, (int)needvalue); } -/*@=unrecog@*/ break; /* XXX redundant with --logical. */ @@ -3542,16 +3377,13 @@ fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); poptPrintUsage(con, stderr, 0); exit(EXIT_FAILURE); - /*@notreached@*/ break; + break; } } -/*@unchecked@*/ /*@observer@*/ static struct poptOption optionsTable[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, mtreeArgCallback, 0, NULL, NULL }, -/*@=type@*/ /* XXX redundant with --logical. */ { NULL,'L', POPT_ARG_NONE, NULL, (int)'L', @@ -3623,10 +3455,7 @@ }; #if defined(__linux__) -/*@null@*/ /*@observer@*/ static const char *my_getlogin(void) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ { const char *s = getlogin(); @@ -3635,7 +3464,6 @@ } else { struct passwd *pw = getpwuid(geteuid()); char *ss = NULL; -/*@-unrecog@*/ if (pw != NULL && pw->pw_name != NULL && pw->pw_name[0] != '\0') { if (asprintf(&ss, _("(no controlling terminal) %s"), pw->pw_name) < 0) { perror("asprintf"); @@ -3647,7 +3475,6 @@ return NULL; } } -/*@=unrecog@*/ return ss; } } @@ -3658,10 +3485,6 @@ int main(int argc, char *argv[]) - /*@globals _rpmfts, mtreeFlags, excludes, __assert_program_name, - rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies _rpmfts, mtreeFlags, excludes, __assert_program_name, - rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmfts fts = _rpmfts; poptContext optCon; @@ -3701,7 +3524,7 @@ switch (fts->ftsoptions & (FTS_LOGICAL|FTS_PHYSICAL)) { case (FTS_LOGICAL|FTS_PHYSICAL): mtree_error("-L and -P flags are mutually exclusive"); - /*@notreached@*/ break; + break; case 0: fts->ftsoptions |= FTS_PHYSICAL; break; @@ -3743,13 +3566,13 @@ case URL_IS_UNKNOWN: rpath = lpath; lpath = NULL; - /*@switchbreak@*/ break; + break; default: strncpy(fullpath, fts->paths[i], nb); fullpath[nb] = '\0'; rpath = rpmGenPath(fullpath, lpath, NULL); lpath = _free(lpath); - /*@switchbreak@*/ break; + break; } /* Add a trailing '/' on directories. */ @@ -3790,9 +3613,7 @@ if (fts->spec2 != NULL) { rc = mtreeVSpec(fts); } else { -/*@-evalorder@*/ fts->root = mtreeSpec(fts, fts->spec1); -/*@=evalorder@*/ fts->path = xmalloc(MAXPATHLEN); rc = mtreeVWalk(fts); mtreeMiss(fts, fts->root, fts->path); @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmrepo.c ============================================================================ $ cvs diff -u -r2.32.2.5 -r2.32.2.6 rpmrepo.c --- rpm/tools/rpmrepo.c 13 Aug 2014 17:45:49 -0000 2.32.2.5 +++ rpm/tools/rpmrepo.c 16 May 2017 21:22:05 -0000 2.32.2.6 @@ -8,41 +8,6 @@ #include <dbsql.h> #elif defined(WITH_SQLITE) #include <sqlite3.h> -#ifdef __LCLINT__ -/*@-incondefs -redecl @*/ -extern const char *sqlite3_errmsg(sqlite3 *db) - /*@*/; -extern int sqlite3_open( - const char *filename, /* Database filename (UTF-8) */ - /*@out@*/ sqlite3 **ppDb /* OUT: SQLite db handle */ -) - /*@modifies *ppDb @*/; -extern int sqlite3_exec( - sqlite3 *db, /* An open database */ - const char *sql, /* SQL to be evaluted */ - int (*callback)(void*,int,char**,char**), /* Callback function */ - void *, /* 1st argument to callback */ - /*@out@*/ char **errmsg /* Error msg written here */ -) - /*@modifies db, *errmsg @*/; -extern int sqlite3_prepare( - sqlite3 *db, /* Database handle */ - const char *zSql, /* SQL statement, UTF-8 encoded */ - int nByte, /* Maximum length of zSql in bytes. */ - /*@out@*/ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ - /*@out@*/ const char **pzTail /* OUT: Pointer to unused portion of zSql */ -) - /*@modifies *ppStmt, *pzTail @*/; -extern int sqlite3_reset(sqlite3_stmt *pStmt) - /*@modifies pStmt @*/; -extern int sqlite3_step(sqlite3_stmt *pStmt) - /*@modifies pStmt @*/; -extern int sqlite3_finalize(/*@only@*/ sqlite3_stmt *pStmt) - /*@modifies pStmt @*/; -extern int sqlite3_close(sqlite3 * db) - /*@modifies db @*/; -/*@=incondefs =redecl @*/ -#endif /* __LCLINT__ */ #endif /* WITH_SQLITE */ #include <rpmio_internal.h> /* XXX fdInitDigest() et al */ @@ -81,14 +46,12 @@ #endif /* __cplusplus */ extern poptContext -rpmcliFini(/*@only@*/ /*@null@*/ poptContext optCon); +rpmcliFini(poptContext optCon); /*==============================================================*/ int main(int argc, char *argv[]) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmrepo repo; int rc = 1; /* assume failure. */ @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmwget.c ============================================================================ $ cvs diff -u -r1.5.4.3 -r1.5.4.4 rpmwget.c --- rpm/tools/rpmwget.c 1 May 2015 14:37:53 -0000 1.5.4.3 +++ rpm/tools/rpmwget.c 16 May 2017 21:22:05 -0000 1.5.4.4 @@ -58,7 +58,6 @@ WCTL_FLAGS_RELATIVEONLY = _WFB(11), /*!< -L,--relative ... */ WCTL_FLAGS_NOPARENT = _WFB(12), /*!< -np,--no-parent ... */ }; -/*@unchecked@*/ static enum rpmioWCTLFlags_e rpmioWCTLFlags = WCTL_FLAGS_NONE; enum rpmioWDLFlags_e { @@ -70,7 +69,6 @@ WDL_FLAGS_INET4 = _WFB(11), /*!< --inet4-only ... */ WDL_FLAGS_INET6 = _WFB(12), /*!< --inet6-only ... */ }; -/*@unchecked@*/ static enum rpmioWDLFlags_e rpmioWDLFlags = WDL_FLAGS_NONE; enum rpmioWDirFlags_e { @@ -80,7 +78,6 @@ WDIR_FLAGS_NOHOST = _WFB( 2), /*!< --no-host-directories ... */ WDIR_FLAGS_ADDPROTO = _WFB( 3), /*!< --protocol-directories ... */ }; -/*@unchecked@*/ static enum rpmioWDirFlags_e rpmioWDirFlags = WDIR_FLAGS_NONE; enum rpmioHttpFlags_e { @@ -94,14 +91,12 @@ HTTP_FLAGS_NOCHALLENGE = _WFB( 6), /*!< --auth-no-challenge ... */ HTTP_FLAGS_SAVEHEADERS = _WFB( 7), /*!< --save-headers ... */ }; -/*@unchecked@*/ static enum rpmioHttpFlags_e rpmioHttpFlags = HTTP_FLAGS_NONE; enum rpmioHttpsFlags_e { HTTPS_FLAGS_NONE = 0, HTTPS_FLAGS_NOCHECK = _WFB( 0), /*!< --no-check-certificate ... */ }; -/*@unchecked@*/ static enum rpmioHttpsFlags_e rpmioHttpsFlags = HTTPS_FLAGS_NONE; enum rpmioFtpFlags_e { @@ -112,7 +107,6 @@ FTP_FLAGS_FOLLOW = _WFB( 3), /*!< --retr-symlinks ... */ FTP_FLAGS_PRESERVE = _WFB( 4), /*!< --preserve-permissions ... */ }; -/*@unchecked@*/ static enum rpmioFtpFlags_e rpmioFtpFlags = FTP_FLAGS_NONE; /** @@ -134,7 +128,6 @@ FD_t ofd; /*!< Output file handle. */ struct stat * st; /*!< Output file stat(2) */ -/*@null@*/ const char * bartype; /*!< Progress bar display type. */ int maxcols; /*!< Display width. */ rpmop rop; /*!< URI Receive accumulator. */ @@ -222,7 +215,6 @@ const char * reject_dirs; /*!< -X,--exclude-directories ... */ }; -/*@unchecked@*/ static struct rpmwget_s __rpmwget = { .debug = -1, .verbose = -1, @@ -240,14 +232,12 @@ .http_ext = ".html" }; -/*@unchecked@*/ static rpmwget _rpmwget = &__rpmwget; /*==============================================================*/ /** */ static const char * wgetSuffix(const char * s) - /*@*/ { const char * se = s + strlen(s); @@ -331,7 +321,7 @@ /** */ -static const char * wgetProgress(rpmwget wget, /*@null@*/ rpmop op) +static const char * wgetProgress(rpmwget wget, rpmop op) { unsigned long long cur = (op ? op->bytes : 0); static char * tbuf = NULL; @@ -433,8 +423,7 @@ /** */ -static int wgetSetRate(rpmwget wget, /*@null@*/ const urlinfo u, rpmop op) - /*@modifies wget, op @*/ +static int wgetSetRate(rpmwget wget, const urlinfo u, rpmop op) { unsigned long long progress; unsigned long long total; @@ -482,9 +471,8 @@ /** */ -static int wgetSetDelay(rpmwget wget, /*@null@*/ const urlinfo u, +static int wgetSetDelay(rpmwget wget, const urlinfo u, const rpmop op) - /*@modifies wget @*/ { static int fac = 9; rpmop top; @@ -917,7 +905,6 @@ /** */ static int wgetLoadManifests(rpmwget wget) - /*@modifies wget @*/ { ARGV_t manifests; const char * fn; @@ -1003,10 +990,9 @@ /** */ static void rpmwgetArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, + enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, void * data) - /*@modifies data @*/ { /* XXX make sure wget!=NULL even if popt table callback item doesn't set */ rpmwget wget = (rpmwget) (data ? data : _rpmwget); @@ -1097,13 +1083,12 @@ default: fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); poptPrintUsage(con, stderr, 0); - /*@-exitarg@*/ exit(2); /*@=exitarg@*/ - /*@notreached@*/ break; + exit(2); + break; } } /*==============================================================*/ -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioWCTLStartupPoptTable[] = { { "version", 'V', POPT_ARG_NONE, NULL, 'V', N_("display the version of Wget and exit."), NULL }, @@ -1118,13 +1103,10 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioWCTLLoggingPoptTable[] = { #ifndef NOTYET /* XXX popt sub-tables should inherit callback from parent? */ -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmwgetArgCallback, 0, (const char *)&__rpmwget, NULL }, -/*@=type@*/ #endif { "output-file", 'o', POPT_ARG_STRING, 0, POPTWGET_LOGFILE, @@ -1150,7 +1132,6 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioWDLPoptTable[] = { /* XXX popt sub-tables should inherit callback from parent? */ @@ -1224,7 +1205,6 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioWDirPoptTable[] = { { "no-directories", '\0', POPT_BIT_SET, &rpmioWDirFlags, WDIR_FLAGS_NOCREATE, N_("don't create directories."), NULL }, @@ -1245,7 +1225,6 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioHttpPoptTable[] = { { "http-user", '\0', POPT_ARG_STRING, &__rpmwget.http_user, 0, N_("set http user to USER."), N_("USER") }, @@ -1296,7 +1275,6 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioHttpsPoptTable[] = { { "secure-protocol", '\0', POPT_ARG_STRING, &__rpmwget.https_protocol, 0, N_("choose secure protocol, one of auto, SSLv2, SSLv3, and TLSv1."), N_("PR") }, @@ -1321,7 +1299,6 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioFtpPoptTable[] = { { "ftp-user", '\0', POPT_ARG_STRING, &__rpmwget.ftp_user, 0, N_("set ftp user to USER."), N_("USER") }, @@ -1340,7 +1317,6 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioWCTLDownloadPoptTable[] = { { "recursive", 'r', POPT_BIT_SET, &rpmioWCTLFlags, WCTL_FLAGS_RECURSE, N_("specify recursive download."), NULL }, @@ -1362,7 +1338,6 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmioWCTLAcceptPoptTable[] = { { "accept", 'A', POPT_ARG_STRING, &__rpmwget.accept_exts, 0, N_("comma-separated list of accepted extensions."), N_("LIST") }, @@ -1393,13 +1368,10 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption optionsTable[] = { #ifdef NOTYET /* XXX popt sub-tables should inherit callback from parent? */ -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmwgetArgCallback, 0, (const char *)&__rpmwget, NULL }, -/*@=type@*/ #endif { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioWCTLStartupPoptTable, 0, @@ -1453,10 +1425,6 @@ int main(int argc, char *argv[]) - /*@globals __assert_program_name, - rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies __assert_program_name, _rpmrepo, - rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmwget wget = _rpmwget; poptContext optCon; @@ -1465,9 +1433,7 @@ int xx; int i; -/*@-observertrans -readonlytrans @*/ __progname = "rpmwget"; -/*@=observertrans =readonlytrans @*/ /* Initialize configuration. */ /* XXX read system/user wgetrc */ @@ . patch -p0 <<'@@ .' Index: rpm/tools/semodule.c ============================================================================ $ cvs diff -u -r2.6 -r2.6.4.1 semodule.c --- rpm/tools/semodule.c 21 Mar 2010 23:21:34 -0000 2.6 +++ rpm/tools/semodule.c 16 May 2017 21:22:05 -0000 2.6.4.1 @@ -15,11 +15,9 @@ /** */ static void rpmsmArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, + enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, - /*@unused@*/ void * data) - /*@globals _rpmsm, h_errno, fileSystem, internalState @*/ - /*@modifies _rpmsm, fileSystem, internalState @*/ + void * data) { rpmsm sm = _rpmsmI; char * t = NULL; @@ -83,17 +81,14 @@ fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); poptPrintUsage(con, stderr, 0); exit(EXIT_FAILURE); - /*@notreached@*/ break; + break; } t = _free(t); } -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmsmOtherTable[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmsmArgCallback, 0, NULL, NULL }, -/*@=type@*/ { "store",'s', POPT_ARG_STRING, NULL, (int)'s', N_("Set the STORE to operate on (e.g. \"targeted\")"), N_("STORE") }, { "noreload",'n', POPT_ARG_NONE, NULL, (int)'n', @@ -103,12 +98,9 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmsmOptionsTable[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmsmArgCallback, 0, NULL, NULL }, -/*@=type@*/ { "list",'l', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, NULL, (int)'l', N_("Display list of installed policy modules"), N_("REGEX") }, @@ -167,7 +159,7 @@ for (i = 0; i < ac; i++) fprintf(stderr, " %s", av[i]); goto exit; - /*@notreached@*/ break; + break; case 'i': case 'u': case 'r': @@ . patch -p0 <<'@@ .' Index: rpm/tools/spooktool.c ============================================================================ $ cvs diff -u -r2.4.4.1 -r2.4.4.2 spooktool.c --- rpm/tools/spooktool.c 23 Sep 2014 18:30:31 -0000 2.4.4.1 +++ rpm/tools/spooktool.c 16 May 2017 21:22:05 -0000 2.4.4.2 @@ -52,7 +52,7 @@ return rc; } -static rpmRC cmd_help(int ac, /*@unused@*/ char *av[]) +static rpmRC cmd_help(int ac, char *av[]) { FILE * fp = stdout; struct poptOption * c; @@ -201,7 +201,7 @@ break; case RPMRC_NOTFOUND: goto exit; - /*@notreached@*/ break; + break; default: break; } @@ -218,11 +218,9 @@ /** */ static void rpmsmArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, + enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, - /*@unused@*/ void * data) - /*@globals _rpmsm, h_errno, fileSystem, internalState @*/ - /*@modifies _rpmsm, fileSystem, internalState @*/ + void * data) { rpmsm sm = _rpmsmI; char * t = NULL; @@ -286,17 +284,14 @@ fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); poptPrintUsage(con, stderr, 0); exit(EXIT_FAILURE); - /*@notreached@*/ break; + break; } t = _free(t); } -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmsmOtherTable[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmsmArgCallback, 0, NULL, NULL }, -/*@=type@*/ { "store",'s', POPT_ARG_STRING, NULL, (int)'s', N_("Set the STORE to operate on (e.g. \"targeted\")"), N_("STORE") }, { "noreload",'n', POPT_ARG_NONE, NULL, (int)'n', @@ -306,12 +301,9 @@ POPT_TABLEEND }; -/*@unchecked@*/ /*@observer@*/ static struct poptOption rpmsmOptionsTable[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmsmArgCallback, 0, NULL, NULL }, -/*@=type@*/ { "list",'l', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, NULL, (int)'l', N_("Display list of installed policy modules"), N_("REGEX") }, @@ -376,7 +368,7 @@ for (i = 0; i < ac; i++) fprintf(stderr, " %s", av[i]); goto exit; - /*@notreached@*/ break; + break; case 'i': case 'u': case 'r': @@ . patch -p0 <<'@@ .' Index: rpm/tools/xiu-hash.c ============================================================================ $ cvs diff -u -r2.1.4.1 -r2.1.4.2 xiu-hash.c --- rpm/tools/xiu-hash.c 4 Jun 2012 15:10:41 -0000 2.1.4.1 +++ rpm/tools/xiu-hash.c 16 May 2017 21:22:05 -0000 2.1.4.2 @@ -1,5 +1,4 @@ #include "system.h" -/*@unchecked@*/ extern const char * __progname; #define _RPMIOB_INTERNAL @@ -54,7 +53,6 @@ enum dcFlags_e flags; /*!< rpmdc control bits. */ uint32_t algo; /*!< default digest algorithm. */ uint32_t dalgo; /*!< digest algorithm. */ -/*@observer@*/ /*@null@*/ const char * dalgoName; /*!< digest algorithm name. */ const char * digest; size_t digestlen; @@ -247,7 +245,6 @@ static int rpmdcVisitF(rpmdc dc) - /*@modifies dc @*/ { int rc = 0; int xx; @@ -265,7 +262,6 @@ return rc; } -/*@null@*/ static const char * rpmdcPrintNix(rpmdc dc, int rc) { char * t, * te; @@ -294,10 +290,9 @@ /*==============================================================*/ static void nixArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, + enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, - /*@unused@*/ void * data) - /*@*/ + void * data) { /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ if (opt->arg == NULL) @@ -305,17 +300,15 @@ default: fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); poptPrintUsage(con, stderr, 0); - /*@-exitarg@*/ exit(2); /*@=exitarg@*/ - /*@notreached@*/ break; + exit(2); + break; break; } } static struct poptOption optionsTable[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, nixArgCallback, 0, NULL, NULL }, -/*@=type@*/ { "flat", '\0', POPT_BIT_SET, &_dc.flags, RPMDC_FLAGS_FLAT, N_("compute hash of regular file contents, not metadata"), NULL }, @@ . patch -p0 <<'@@ .' Index: rpm/tools/xiu-instantiate.c ============================================================================ $ cvs diff -u -r2.2 -r2.2.4.1 xiu-instantiate.c --- rpm/tools/xiu-instantiate.c 1 Apr 2010 00:55:29 -0000 2.2 +++ rpm/tools/xiu-instantiate.c 16 May 2017 21:22:05 -0000 2.2.4.1 @@ -71,10 +71,9 @@ }; static void rpmnixInstantiateArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, + enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, - /*@unused@*/ void * data) - /*@*/ + void * data) { #ifdef UNUSED rpmnix nix = &_nix; @@ -105,16 +104,14 @@ default: fprintf(stderr, _("%s: Unknown callback(0x%x)\n"), __FUNCTION__, (unsigned) opt->val); poptPrintUsage(con, stderr, 0); - /*@-exitarg@*/ exit(2); /*@=exitarg@*/ - /*@notreached@*/ break; + exit(2); + break; } } struct poptOption _rpmnixInstantiateOptions[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmnixInstantiateArgCallback, 0, NULL, NULL }, -/*@=type@*/ { "eval-only", '\0', POPT_BIT_SET, &_nix.flags, RPMNIX_FLAGS_EVALONLY, N_("evaluate and print resulting term; do not instantiate"), NULL }, @@ . patch -p0 <<'@@ .' Index: rpm/tools/xiu-store.c ============================================================================ $ cvs diff -u -r2.2.4.1 -r2.2.4.2 xiu-store.c --- rpm/tools/xiu-store.c 4 Jun 2012 15:10:41 -0000 2.2.4.1 +++ rpm/tools/xiu-store.c 16 May 2017 21:22:06 -0000 2.2.4.2 @@ -118,10 +118,9 @@ }; static void rpmnixStoreArgCallback(poptContext con, - /*@unused@*/ enum poptCallbackReason reason, + enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, - /*@unused@*/ void * data) - /*@*/ + void * data) { rpmnix nix = &_nix; @@ -152,16 +151,14 @@ default: fprintf(stderr, _("%s: Unknown callback(0x%x)\n"), __FUNCTION__, (unsigned) opt->val); poptPrintUsage(con, stderr, 0); - /*@-exitarg@*/ exit(2); /*@=exitarg@*/ - /*@notreached@*/ break; + exit(2); + break; } } static struct poptOption _rpmnixStoreOptions[] = { -/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, rpmnixStoreArgCallback, 0, NULL, NULL }, -/*@=type@*/ { "max-jobs", 'j', POPT_ARG_INT, &_nix.jobs, 0, N_("FIXME"), N_("JOBS") }, @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org