summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-10-04 19:40:03 +0000
committerjbj <devnull@localhost>1999-10-04 19:40:03 +0000
commitcabcec362682a5bd68d5acc2191333cb903a2e4e (patch)
tree5f0d997e93e252f38bacceac68d9c223bb237b29
parent767f75648fb05790ddb3200cba8ddf730a136dd2 (diff)
downloadrpm-cabcec362682a5bd68d5acc2191333cb903a2e4e.tar.gz
rpm-cabcec362682a5bd68d5acc2191333cb903a2e4e.tar.bz2
rpm-cabcec362682a5bd68d5acc2191333cb903a2e4e.zip
lclint annotations from build.
CVS patchset: 3366 CVS date: 1999/10/04 19:40:03
-rw-r--r--build/.lclintrc6
-rw-r--r--build/expression.c2
-rw-r--r--build/files.c7
-rw-r--r--build/names.c16
-rw-r--r--build/pack.c3
-rw-r--r--build/parseChangelog.c2
-rw-r--r--build/parseDescription.c4
-rw-r--r--build/parseFiles.c4
-rw-r--r--build/parsePreamble.c9
-rw-r--r--build/parsePrep.c2
-rw-r--r--build/parseScript.c6
-rw-r--r--build/reqprov.c2
-rw-r--r--build/rpmbuild.h14
-rw-r--r--build/rpmspec.h18
-rw-r--r--build/spec.c4
-rw-r--r--po/rpm.pot76
-rw-r--r--popt/popt.h3
17 files changed, 91 insertions, 87 deletions
diff --git a/build/.lclintrc b/build/.lclintrc
index 6a8c8c568..b2325aea6 100644
--- a/build/.lclintrc
+++ b/build/.lclintrc
@@ -1,4 +1,4 @@
--I. -I.. -I../lib -DHAVE_CONFIG_H
+-I. -I.. -I../build -I../lib -I../popt -DHAVE_CONFIG_H
+partial
@@ -9,9 +9,9 @@
# don't-bother-me-yet parameters
-branchstate
--immediatetrans
+#-immediatetrans
-mustfree
--observertrans
+#-observertrans
-statictrans
# not-yet normal parameters
diff --git a/build/expression.c b/build/expression.c
index 1b053d4ec..024068b10 100644
--- a/build/expression.c
+++ b/build/expression.c
@@ -22,7 +22,7 @@
#include <stdio.h>
#define DEBUG(x) do { x ; } while (0)
#else
-#define DEBUG(x) do { } while (0)
+#define DEBUG(x)
#endif
diff --git a/build/files.c b/build/files.c
index 050c8f15f..0b5df24b3 100644
--- a/build/files.c
+++ b/build/files.c
@@ -31,8 +31,8 @@ typedef struct {
const char *diskName; /* get file from here */
const char *fileName; /* filename in cpio archive */
- const char *uname;
- const char *gname;
+ /*@observer@*/ const char *uname;
+ /*@observer@*/ const char *gname;
int flags;
int verifyFlags;
const char *langs; /* XXX locales separated with | */
@@ -917,7 +917,8 @@ static int addFile(struct FileList *fl, const char *diskName, struct stat *statp
mode_t fileMode;
uid_t fileUid;
gid_t fileGid;
- char *fileUname, *fileGname;
+ const char *fileUname;
+ const char *fileGname;
char *lang;
/* Path may have prepended buildroot, so locate the original filename. */
diff --git a/build/names.c b/build/names.c
index 5e3b47d7d..806bb617c 100644
--- a/build/names.c
+++ b/build/names.c
@@ -5,18 +5,18 @@
#include "rpmbuild.h"
static uid_t uids[1024];
-static char *unames[1024];
+/*@owned@*/ /*@null@*/ static char *unames[1024];
static int uid_used = 0;
static gid_t gids[1024];
-static char *gnames[1024];
+/*@owned@*/ /*@null@*/ static char *gnames[1024];
static int gid_used = 0;
/*
* getUname() takes a uid, gets the username, and creates an entry in the
* table to hold a string containing the user name.
*/
-char *getUname(uid_t uid)
+const char *getUname(uid_t uid)
{
struct passwd *pw;
int x;
@@ -48,7 +48,7 @@ char *getUname(uid_t uid)
* getUnameS() takes a username, gets the uid, and creates an entry in the
* table to hold a string containing the user name.
*/
-char *getUnameS(const char *uname)
+const char *getUnameS(const char *uname)
{
struct passwd *pw;
int x;
@@ -81,7 +81,7 @@ char *getUnameS(const char *uname)
* getGname() takes a gid, gets the group name, and creates an entry in the
* table to hold a string containing the group name.
*/
-char *getGname(gid_t gid)
+const char *getGname(gid_t gid)
{
struct group *gr;
int x;
@@ -113,7 +113,7 @@ char *getGname(gid_t gid)
* getGnameS() takes a group name, gets the gid, and creates an entry in the
* table to hold a string containing the group name.
*/
-char *getGnameS(const char *gname)
+const char *getGnameS(const char *gname)
{
struct group *gr;
int x;
@@ -153,7 +153,7 @@ time_t *const getBuildTime(void)
return &buildTime;
}
-char *const buildHost(void)
+const char *const buildHost(void)
{
static char hostname[1024];
static int gotit = 0;
@@ -161,7 +161,7 @@ char *const buildHost(void)
if (! gotit) {
gethostname(hostname, sizeof(hostname));
- if ((hbn = gethostbyname(hostname))) {
+ if ((hbn = /*@-unrecog@*/ gethostbyname(hostname) /*@=unrecog@*/ )) {
strcpy(hostname, hbn->h_name);
} else {
rpmMessage(RPMMESS_WARNING, _("Could not canonicalize hostname: %s\n"),
diff --git a/build/pack.c b/build/pack.c
index b9c8710fe..ef6dcb20b 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -218,7 +218,7 @@ int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead, Header *sig
default:
rpmError(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"), fileName);
return RPMERR_BADMAGIC;
- break;
+ /*@notreached@*/ break;
}
if (specp)
@@ -438,6 +438,7 @@ static int cpio_gzip(FD_t fdo, CSA_t *csa)
}
gzdClose(cfd->cpioGzFd);
+ cfd->cpioGzFd = NULL;
if (failedFile)
xfree(failedFile);
diff --git a/build/parseChangelog.c b/build/parseChangelog.c
index ff369194e..43ed49e61 100644
--- a/build/parseChangelog.c
+++ b/build/parseChangelog.c
@@ -23,7 +23,7 @@ void addChangelogEntry(Header h, time_t time, const char *name, const char *text
}
/* datestr is of the form 'Wed Jan 1 1997' */
-static int dateToTimet(const char * datestr, time_t * secs)
+static int dateToTimet(const char * datestr, /*@out@*/ time_t * secs)
{
struct tm time;
char *p, *pe, *q, ** idx;
diff --git a/build/parseDescription.c b/build/parseDescription.c
index fdd4541dc..009a8ee29 100644
--- a/build/parseDescription.c
+++ b/build/parseDescription.c
@@ -5,8 +5,8 @@
extern int noLang; /* XXX FIXME: pass as arg */
/* These have to be global scope to make up for *stupid* compilers */
- static char *name;
- static char *lang;
+ /*@observer@*/ /*@null@*/ static char *name;
+ /*@observer@*/ /*@null@*/ static char *lang;
static struct poptOption optionsTable[] = {
{ NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL},
diff --git a/build/parseFiles.c b/build/parseFiles.c
index 2c6f2c492..9cafb7cbd 100644
--- a/build/parseFiles.c
+++ b/build/parseFiles.c
@@ -3,8 +3,8 @@
#include "rpmbuild.h"
/* These have to be global scope to make up for *stupid* compilers */
- static char *name;
- static char *file;
+ /*@observer@*/ /*@null@*/ static char *name;
+ /*@observer@*/ /*@null@*/ static char *file;
static struct poptOption optionsTable[] = {
{ NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL},
{ NULL, 'f', POPT_ARG_STRING, &file, 'f', NULL, NULL},
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index bf05a63aa..43451aa5c 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -272,9 +272,10 @@ exit:
struct spectag *
stashSt(Spec spec, Header h, int tag, const char *lang)
{
- struct spectags *st = spec->st;
struct spectag *t = NULL;
- if (st) {
+
+ if (spec->st) {
+ struct spectags *st = spec->st;
if (st->st_ntags == st->st_nalloc) {
st->st_nalloc += 10;
st->st_t = xrealloc(st->st_t, st->st_nalloc * sizeof(*(st->st_t)));
@@ -368,8 +369,8 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
break;
case RPMTAG_GROUP:
case RPMTAG_SUMMARY:
- stashSt(spec, pkg->header, tag, lang);
- /* fall thru */
+ (void) stashSt(spec, pkg->header, tag, lang);
+ /*@fallthrough@*/
case RPMTAG_DISTRIBUTION:
case RPMTAG_VENDOR:
case RPMTAG_LICENSE:
diff --git a/build/parsePrep.c b/build/parsePrep.c
index 6f3bba589..13c79bde6 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -5,7 +5,7 @@
/* These have to be global to make up for stupid compilers */
static int leaveDirs, skipDefaultAction;
static int createDir, quietly;
- static char * dirName;
+ /*@observer@*/ /*@null@*/ static char * dirName;
static struct poptOption optionsTable[] = {
{ NULL, 'a', POPT_ARG_STRING, NULL, 'a', NULL, NULL},
{ NULL, 'b', POPT_ARG_STRING, NULL, 'b', NULL, NULL},
diff --git a/build/parseScript.c b/build/parseScript.c
index 8ce55a057..6802b0de6 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -36,9 +36,9 @@ static int addTriggerIndex(Package pkg, char *file, char *script, char *prog)
}
/* these have to be global because of stupid compilers */
- static char *name;
- static char *prog;
- static char *file;
+ /*@observer@*/ /*@null@*/ static char *name;
+ /*@observer@*/ /*@null@*/ static char *prog;
+ /*@observer@*/ /*@null@*/ static char *file;
static struct poptOption optionsTable[] = {
{ NULL, 'p', POPT_ARG_STRING, &prog, 'p', NULL, NULL},
{ NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL},
diff --git a/build/reqprov.c b/build/reqprov.c
index 62681a6cf..fd655f5a0 100644
--- a/build/reqprov.c
+++ b/build/reqprov.c
@@ -4,7 +4,7 @@
#include "rpmbuild.h"
-int addReqProv(Spec spec, Header h,
+int addReqProv(/*@unused@*/ Spec spec, Header h,
int flag, const char *name, const char *version, int index)
{
const char **names;
diff --git a/build/rpmbuild.h b/build/rpmbuild.h
index d7f5d0400..81be09e75 100644
--- a/build/rpmbuild.h
+++ b/build/rpmbuild.h
@@ -69,13 +69,13 @@ extern "C" {
/* from build/names.h */
-char *getUname(uid_t uid);
-char *getUnameS(const char *uname);
-char *getGname(gid_t gid);
-char *getGnameS(const char *gname);
+/*@observer@*/ const char *getUname(uid_t uid);
+/*@observer@*/ const char *getUnameS(const char *uname);
+/*@observer@*/ const char *getGname(gid_t gid);
+/*@observer@*/ const char *getGnameS(const char *gname);
-char *const buildHost(void);
-time_t *const getBuildTime(void);
+/*@observer@*/ const char *const buildHost(void);
+/*@observer@*/ time_t *const getBuildTime(void);
/* from build/read.h */
@@ -127,7 +127,7 @@ void freePackage(/*@only@*/ Package p);
/* from build/reqprov.h */
-int addReqProv(Spec spec, Header h,
+int addReqProv(/*@unused@*/Spec spec, Header h,
int flag, const char *name, const char *version, int index);
/* from build/files.h */
diff --git a/build/rpmspec.h b/build/rpmspec.h
index 379aead8e..007706c6b 100644
--- a/build/rpmspec.h
+++ b/build/rpmspec.h
@@ -55,13 +55,13 @@ struct spectag {
int t_tag;
int t_startx;
int t_nlines;
- char *t_lang;
- char *t_msgid;
+ /*@only@*/ const char *t_lang;
+ /*@only@*/ const char *t_msgid;
};
struct spectags {
- struct spectag *st_t;
+ /*@owned@*/ struct spectag *st_t;
int st_nalloc;
int st_ntags;
};
@@ -73,11 +73,11 @@ struct speclines {
};
struct SpecStruct {
- /*@only@*/ char *specFile;
- /*@only@*/ char *sourceRpmName;
+ /*@only@*/ const char *specFile;
+ /*@only@*/ const char *sourceRpmName;
- struct speclines *sl;
- struct spectags *st;
+ /*@owned@*/ struct speclines *sl;
+ /*@owned@*/ struct spectags *st;
/*@owned@*/ struct OpenFileInfo *fileStack;
char lbuf[BUFSIZ];
@@ -88,7 +88,7 @@ struct SpecStruct {
/*@only@*/ struct ReadLevelEntry *readStack;
- Header buildRestrictions;
+ /*@refcounted@*/ Header buildRestrictions;
/*@owned@*/ struct SpecStruct **buildArchitectureSpecs;
char ** buildArchitectures;
int buildArchitectureCount;
@@ -109,7 +109,7 @@ struct SpecStruct {
int numSources;
int noSource;
- Header sourceHeader;
+ /*@refcounted@*/ Header sourceHeader;
int sourceCpioCount;
/*@owned@*/ struct cpioFileMapping *sourceCpioList;
diff --git a/build/spec.c b/build/spec.c
index b511db682..6acc9e45a 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -354,7 +354,7 @@ static inline struct speclines * newSl(void)
return sl;
}
-static inline void freeSl(struct speclines *sl)
+static inline void freeSl(/*@only@*/struct speclines *sl)
{
int i;
if (sl == NULL)
@@ -377,7 +377,7 @@ static inline struct spectags * newSt(void)
return st;
}
-static inline void freeSt(struct spectags *st)
+static inline void freeSt(/*@only@*/struct spectags *st)
{
int i;
if (st == NULL)
diff --git a/po/rpm.pot b/po/rpm.pot
index 42358dfb1..f74f80f38 100644
--- a/po/rpm.pot
+++ b/po/rpm.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-10-04 13:09-0400\n"
+"POT-Creation-Date: 1999-10-04 15:16-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1372,81 +1372,81 @@ msgstr ""
msgid "File listed twice: %s"
msgstr ""
-#: build/files.c:950
+#: build/files.c:951
#, c-format
msgid "File doesn't match prefix (%s): %s"
msgstr ""
-#: build/files.c:960
+#: build/files.c:961
#, c-format
msgid "File not found: %s"
msgstr ""
-#: build/files.c:1003
+#: build/files.c:1004
#, c-format
msgid "Bad owner/group: %s\n"
msgstr ""
-#: build/files.c:1017
+#: build/files.c:1018
#, c-format
msgid "File %4d: %07o %s.%s\t %s\n"
msgstr ""
-#: build/files.c:1087
+#: build/files.c:1088
#, c-format
msgid "File needs leading \"/\": %s"
msgstr ""
-#: build/files.c:1131
+#: build/files.c:1132
#, c-format
msgid "File not found by glob: %s"
msgstr ""
-#: build/files.c:1173
+#: build/files.c:1174
msgid "Could not open %%files file: %s"
msgstr ""
-#: build/files.c:1180 build/pack.c:484
+#: build/files.c:1181 build/pack.c:485
#, c-format
msgid "line: %s"
msgstr ""
-#: build/files.c:1507 build/parsePrep.c:29
+#: build/files.c:1508 build/parsePrep.c:29
#, c-format
msgid "Bad owner/group: %s"
msgstr ""
-#: build/files.c:1561
+#: build/files.c:1562
#, c-format
msgid "Couldn't exec %s: %s"
msgstr ""
-#: build/files.c:1566
+#: build/files.c:1567
#, c-format
msgid "Couldn't fork %s: %s"
msgstr ""
-#: build/files.c:1648
+#: build/files.c:1649
#, c-format
msgid "%s failed"
msgstr ""
-#: build/files.c:1652
+#: build/files.c:1653
#, c-format
msgid "failed to write all data to %s"
msgstr ""
-#: build/files.c:1741
+#: build/files.c:1742
#, c-format
msgid "Finding %s: (using %s)...\n"
msgstr ""
-#: build/files.c:1769 build/files.c:1778
+#: build/files.c:1770 build/files.c:1779
#, c-format
msgid "Failed to find %s:"
msgstr ""
-#: build/files.c:1884
+#: build/files.c:1885
#, c-format
msgid "Processing files: %s-%s-%s\n"
msgstr ""
@@ -1528,42 +1528,42 @@ msgstr ""
msgid "create archive failed on file %s: %s"
msgstr ""
-#: build/pack.c:454
+#: build/pack.c:455
#, c-format
msgid "cpio_copy write failed: %s"
msgstr ""
-#: build/pack.c:461
+#: build/pack.c:462
#, c-format
msgid "cpio_copy read failed: %s"
msgstr ""
-#: build/pack.c:540
+#: build/pack.c:541
#, c-format
msgid "Could not open PreIn file: %s"
msgstr ""
-#: build/pack.c:547
+#: build/pack.c:548
#, c-format
msgid "Could not open PreUn file: %s"
msgstr ""
-#: build/pack.c:554
+#: build/pack.c:555
#, c-format
msgid "Could not open PostIn file: %s"
msgstr ""
-#: build/pack.c:561
+#: build/pack.c:562
#, c-format
msgid "Could not open PostUn file: %s"
msgstr ""
-#: build/pack.c:569
+#: build/pack.c:570
#, c-format
msgid "Could not open VerifyScript file: %s"
msgstr ""
-#: build/pack.c:585
+#: build/pack.c:586
#, c-format
msgid "Could not open Trigger script file: %s"
msgstr ""
@@ -1674,68 +1674,68 @@ msgstr ""
msgid "Unknown icon type: %s"
msgstr ""
-#: build/parsePreamble.c:323
+#: build/parsePreamble.c:324
#, c-format
msgid "line %d: Malformed tag: %s"
msgstr ""
#. Empty field
-#: build/parsePreamble.c:331
+#: build/parsePreamble.c:332
#, c-format
msgid "line %d: Empty tag: %s"
msgstr ""
-#: build/parsePreamble.c:354 build/parsePreamble.c:361
+#: build/parsePreamble.c:355 build/parsePreamble.c:362
#, c-format
msgid "line %d: Illegal char '-' in %s: %s"
msgstr ""
-#: build/parsePreamble.c:399
+#: build/parsePreamble.c:400
#, c-format
msgid "line %d: BuildRoot can not be \"/\": %s"
msgstr ""
-#: build/parsePreamble.c:412
+#: build/parsePreamble.c:413
#, c-format
msgid "line %d: Prefixes must not end with \"/\": %s"
msgstr ""
-#: build/parsePreamble.c:424
+#: build/parsePreamble.c:425
#, c-format
msgid "line %d: Docdir must begin with '/': %s"
msgstr ""
-#: build/parsePreamble.c:436
+#: build/parsePreamble.c:437
#, c-format
msgid "line %d: Epoch/Serial field must be a number: %s"
msgstr ""
-#: build/parsePreamble.c:499
+#: build/parsePreamble.c:500
#, c-format
msgid "line %d: Bad BuildArchitecture format: %s"
msgstr ""
-#: build/parsePreamble.c:509
+#: build/parsePreamble.c:510
#, c-format
msgid "Internal error: Bogus tag %d"
msgstr ""
-#: build/parsePreamble.c:656
+#: build/parsePreamble.c:657
#, c-format
msgid "Bad package specification: %s"
msgstr ""
-#: build/parsePreamble.c:662
+#: build/parsePreamble.c:663
#, c-format
msgid "Package already exists: %s"
msgstr ""
-#: build/parsePreamble.c:689
+#: build/parsePreamble.c:690
#, c-format
msgid "line %d: Unknown tag: %s"
msgstr ""
-#: build/parsePreamble.c:714
+#: build/parsePreamble.c:715
msgid "Spec file can't use BuildRoot"
msgstr ""
diff --git a/popt/popt.h b/popt/popt.h
index c252e6b8a..bf463b579 100644
--- a/popt/popt.h
+++ b/popt/popt.h
@@ -108,7 +108,8 @@ int poptReadConfigFile(poptContext con, const char * fn);
int poptReadDefaultConfig(poptContext con, int useEnv);
/* argv should be freed -- this allows ', ", and \ quoting, but ' is treated
the same as " and both may include \ quotes */
-int poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr);
+int poptParseArgvString(const char * s,
+ /*@out@*/ int * argcPtr, /*@out@*/ char *** argvPtr);
const char * poptStrerror(const int error);
void poptSetExecPath(poptContext con, const char * path, int allowAbsolute);
void poptPrintHelp(poptContext con, FILE * f, int flags);