Commit 18efd694 authored by Bernhard Link's avatar Bernhard Link

remove IFSTUPIDCC, replace with SETBUTNOTUSED

parent 38bdd869
2013-06-02 Bernhard R. Link <brlink@debian.org>
* as gcc got better, remove conditional workarounds for
most uninitialized-false-positives and make the remaining
cases unconditonal (but marked with SETBUTNOTUSED).
2013-05-30 Bernhard R. Link <brlink@debian.org>
* fix bug is restore to only act if the
last package looked at is restored.
......
......@@ -20,7 +20,7 @@ if [ "x$1" = "x--configure" ] ; then
cd "$1" || exit 1
shift
fi
"$repreprodir"/configure --enable-maintainer-mode CFLAGS="-Wall -O2 -g -Wmissing-prototypes -Wstrict-prototypes -Wshadow" CPPFLAGS="-DSTUPIDCC=1" "$@"
"$repreprodir"/configure --enable-maintainer-mode CFLAGS="-Wall -O2 -g -Wmissing-prototypes -Wstrict-prototypes -Wshadow" CPPFLAGS="" "$@"
else
echo "unsupported option $1" >&2
exit 1
......
......@@ -232,7 +232,7 @@ retvalue binaries_getversion(const char *control, char **version) {
}
retvalue binaries_getinstalldata(const struct target *t, const char *packagename, const char *version, architecture_t package_architecture, const char *chunk, char **control, struct strlist *filekeys, struct checksumsarray *origfiles) {
char *sourcename IFSTUPIDCC(=NULL), *basefilename IFSTUPIDCC(=NULL);
char *sourcename, *basefilename;
struct checksumsarray origfilekeys;
retvalue r;
......
......@@ -1507,7 +1507,7 @@ static retvalue config_getline(struct configiterator *iter, /*@out@*/char **resu
}
retvalue config_getlines(struct configiterator *iter, struct strlist *result) {
char *line IFSTUPIDCC(=NULL);
char *line;
struct strlist list;
retvalue r;
......
......@@ -172,7 +172,7 @@ static retvalue gentargetcontents(struct target *target, struct release *release
char *contentsfilename;
struct filetorelease *file;
struct filelist_list *contents;
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
struct target_cursor iterator;
if (onlyneeded && target->saved_wasmodified)
onlyneeded = false;
......
......@@ -156,7 +156,7 @@ static void list_cancelpackage(struct package_list *list, /*@only@*/struct packa
static retvalue list_prepareadd(struct package_list *list, struct target *target, const char *packagename, /*@null@*/const char *v, architecture_t package_architecture, const char *chunk) {
char *version;
char *source, *sourceversion;
struct package *new IFSTUPIDCC(=NULL);
struct package *new SETBUTNOTUSED(= NULL);
retvalue r;
int i;
......@@ -182,6 +182,7 @@ static retvalue list_prepareadd(struct package_list *list, struct target *target
assert (r != RET_NOTHING);
if (RET_WAS_ERROR(r))
return r;
assert (new != NULL);
new->architecture = package_architecture;
r = target->getinstalldata(target, new->name, new->version,
......@@ -480,7 +481,7 @@ retvalue copy_by_name(struct distribution *into, struct distribution *from, int
static retvalue by_source(struct package_list *list, UNUSED(struct distribution *into), UNUSED(struct distribution *from), struct target *desttarget, struct target *fromtarget, void *data) {
struct namelist *d = data;
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
struct target_cursor iterator;
const char *packagename, *chunk;
retvalue result, r;
......@@ -633,7 +634,7 @@ retvalue copy_by_source(struct distribution *into, struct distribution *from, in
static retvalue by_formula(struct package_list *list, UNUSED(struct distribution *into), UNUSED(struct distribution *from), struct target *desttarget, struct target *fromtarget, void *data) {
term *condition = data;
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
struct target_cursor iterator;
const char *packagename, *chunk;
architecture_t package_architecture;
retvalue result, r;
......@@ -669,7 +670,7 @@ static retvalue by_formula(struct package_list *list, UNUSED(struct distribution
static retvalue by_glob(struct package_list *list, UNUSED(struct distribution *into), UNUSED(struct distribution *from), struct target *desttarget, struct target *fromtarget, void *data) {
const char *glob = data;
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
struct target_cursor iterator;
const char *packagename, *chunk;
architecture_t package_architecture;
retvalue result, r;
......
......@@ -1759,7 +1759,7 @@ static int paireddatacompare(UNUSED(DB *db), const DBT *a, const DBT *b) {
}
retvalue database_opentracking(const char *codename, bool readonly, struct table **table_p) {
struct table *table IFSTUPIDCC(=NULL);
struct table *table;
retvalue r;
if (rdb_nopackages) {
......@@ -1787,7 +1787,7 @@ retvalue database_opentracking(const char *codename, bool readonly, struct table
}
retvalue database_openpackages(const char *identifier, bool readonly, struct table **table_p) {
struct table *table IFSTUPIDCC(=NULL);
struct table *table;
retvalue r;
if (rdb_nopackages) {
......
......@@ -521,7 +521,7 @@ retvalue distribution_readall(struct distribution **distributions) {
retvalue distribution_foreach_package(struct distribution *distribution, const struct atomlist *components, const struct atomlist *architectures, const struct atomlist *packagetypes, each_package_action action, each_target_action target_action, void *data) {
retvalue result, r;
struct target *t;
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
struct target_cursor iterator;
const char *package, *control;
result = RET_NOTHING;
......@@ -557,7 +557,7 @@ retvalue distribution_foreach_package_c(struct distribution *distribution, const
retvalue result, r;
struct target *t;
const char *package, *control;
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
struct target_cursor iterator;
result = RET_NOTHING;
for (t = distribution->targets ; t != NULL ; t = t->next) {
......
......@@ -428,7 +428,7 @@ static retvalue filelist_addfiles(struct filelist_list *list, const struct filel
}
retvalue filelist_addpackage(struct filelist_list *list, const char *packagename, const char *section, const char *filekey) {
const struct filelist_package *package IFSTUPIDCC(=NULL);
const struct filelist_package *package;
char *debfilename, *contents = NULL;
retvalue r;
const char *c;
......
......@@ -385,7 +385,7 @@ retvalue filterlist_load(struct filterlist *list, struct configiterator *iter) {
}
static inline bool find(const char *name, /*@null@*/struct filterlistfile *list) {
int cmp IFSTUPIDCC(= 0);
int cmp;
/*@dependent@*/const struct filterlistitem *last = list->last;
assert (last != NULL);
......
......@@ -30,11 +30,9 @@ typedef int _Bool;
#define ISSET(a, b) ((a & b) != 0)
#define NOTSET(a, b) ((a & b) == 0)
#ifdef STUPIDCC
#define IFSTUPIDCC(a) a
#else
#define IFSTUPIDCC(a)
#endif
/* sometimes something is initializes though the value is never used to
* work around some gcc uninitialized-use false-positives */
#define SETBUTNOTUSED(a) a
#ifdef SPLINT
#define UNUSED(a) /*@unused@*/ a
......
......@@ -1147,7 +1147,7 @@ static retvalue candidate_preparechangesfile(const struct candidate *c, struct c
}
static retvalue prepare_deb(const struct incoming *i, const struct candidate *c, struct candidate_perdistribution *per, const struct candidate_file *file) {
const char *section IFSTUPIDCC(=NULL), *priority IFSTUPIDCC(=NULL);
const char *section, *priority;
const char *filekey;
const struct overridedata *oinfo;
struct candidate_package *package;
......@@ -1284,7 +1284,7 @@ static retvalue prepare_source_file(const struct incoming *i, const struct candi
}
static retvalue prepare_dsc(const struct incoming *i, const struct candidate *c, struct candidate_perdistribution *per, const struct candidate_file *file) {
const char *section IFSTUPIDCC(=NULL), *priority IFSTUPIDCC(=NULL);
const char *section, *priority;
const struct overridedata *oinfo;
struct candidate_package *package;
const struct distribution *into = per->into;
......@@ -2242,7 +2242,7 @@ static retvalue candidate_add(struct incoming *i, struct candidate *c) {
}
static retvalue process_changes(struct incoming *i, int ofs) {
struct candidate *c IFSTUPIDCC(=NULL);
struct candidate *c;
retvalue r;
int j, k;
bool broken = false, tried = false;
......
......@@ -145,9 +145,9 @@ static retvalue remember_name(void **root_p, const char *name, char mode, char m
static retvalue remember_filekey(const char *filekey, char mode, char mode_and) {
retvalue r;
component_t c IFSTUPIDCC(= atom_unknown);
struct source_node *node IFSTUPIDCC(= NULL), **found;
const char *basefilename IFSTUPIDCC(= NULL);
component_t c;
struct source_node *node, **found;
const char *basefilename;
r = split_filekey(filekey, &c, &node, &basefilename);
if (RET_WAS_ERROR(r))
......
......@@ -1451,7 +1451,7 @@ retvalue remote_preparelists(struct aptmethodrun *run, bool nodownload) {
struct remote_repository *rr;
struct remote_distribution *rd;
retvalue r;
struct cachedlistfile *oldfiles IFSTUPIDCC(=NULL);
struct cachedlistfile *oldfiles;
r = cachedlists_scandir(&oldfiles);
if (RET_WAS_ERROR(r))
......
......@@ -1323,7 +1323,7 @@ int main(int argc, const char *argv[]) {
bool patchmode = false;
bool repreprohook = false;
int i, count;
const char *sourcename IFSTUPIDCC(=NULL);
const char *sourcename;
int debug = 0;
while ((i = getopt_long(argc, (char**)argv, "+hVDmpR", options, NULL)) != -1) {
......@@ -1389,6 +1389,8 @@ int main(int argc, const char *argv[]) {
return EXIT_FAILURE;
}
sourcename = argv[i++];
} else {
SETBUTNOTUSED( sourcename = NULL; )
}
if (mergemode && patchmode) {
fprintf(stderr,
......
......@@ -523,7 +523,7 @@ retvalue signature_requirement_add(struct signature_requirement **list_p, const
req->num_keys = 0;
do {
bool allow_subkeys, allow_bad;
char *next_key IFSTUPIDCC(=NULL);
char *next_key;
r = parse_condition_part(&allow_subkeys, &allow_bad,
full_condition, &condition, &next_key);
......
......@@ -633,7 +633,7 @@ static retvalue parse_tarfile(struct sourceextraction *e, const char *filename,
/* full file name of requested files ready to analyse */
retvalue sourceextraction_analyse(struct sourceextraction *e, const char *fullfilename) {
retvalue r;
bool found IFSTUPIDCC(= false);
bool found;
#ifndef HAVE_LIBARCHIVE
assert (e->difffile >= 0);
......
......@@ -92,7 +92,7 @@ static retvalue getBasenames(const struct strlist *filelines, /*@out@*/struct st
return r;
r = RET_NOTHING;
for (i = 0 ; i < filelines->count ; i++) {
char *basefilename IFSTUPIDCC(=NULL);
char *basefilename;
const char *fileline = filelines->values[i];
r = calc_parsefileline(fileline, &basefilename);
......
......@@ -258,7 +258,7 @@ retvalue term_compile(term **term_p, const char *origformula, int options, const
/* for the global list */
struct term_atom *first, *last;
/* the atom just read */
struct term_atom *atom IFSTUPIDCC(=NULL);
struct term_atom *atom;
struct {
/*@dependent@*/struct term_atom *firstinand, *firstinor;
} levels[50];
......
......@@ -1473,7 +1473,7 @@ static retvalue verify(const char *changesfilename, struct changes *changes) {
printf("Checking Source packages...\n");
for (file = changes->files; file != NULL ; file = file->next) {
const char *name, *version, *p;
size_t namelen IFSTUPIDCC(=0), versionlen IFSTUPIDCC(=0), l;
size_t namelen, versionlen, l;
bool has_tar, has_diff, has_orig, has_format_tar;
int i;
......@@ -1580,9 +1580,7 @@ static retvalue verify(const char *changesfilename, struct changes *changes) {
} else {
if (*p != '_') {
version = NULL;
#ifdef STUPIDCC
versionlen = 0;
#endif
SETBUTNOTUSED( versionlen = 0; )
if (name != NULL)
fprintf(stderr,
"ERROR: '%s' does not contain a '_' separating name and version!\n",
......@@ -1667,6 +1665,7 @@ static retvalue verify(const char *changesfilename, struct changes *changes) {
if (version == NULL)
continue;
/* versionlen is now always initialized */
if (sfile->type == ft_ORIG_TAR) {
const char *q, *revision;
......@@ -2962,7 +2961,7 @@ int main(int argc, char *argv[]) {
bool create_file = false;
bool all_fields = false;
struct strlist searchpath;
struct changes *changesdata IFSTUPIDCC(=NULL);
struct changes *changesdata;
char *gunzip = NULL, *bunzip2 = NULL, *unlzma = NULL,
*unxz = NULL, *lunzip = NULL;
retvalue r;
......
......@@ -514,7 +514,7 @@ retvalue tracking_drop(const char *codename) {
static retvalue tracking_recreatereferences(trackingdb t) {
struct cursor *cursor;
retvalue result, r;
struct trackedpackage *pkg IFSTUPIDCC(=NULL);
struct trackedpackage *pkg;
char *id;
int i;
const char *key, *value, *data;
......@@ -577,7 +577,7 @@ retvalue tracking_remove(trackingdb t, const char *sourcename, const char *versi
const char *data;
size_t datalen;
char *id;
struct trackedpackage *pkg IFSTUPIDCC(=NULL);
struct trackedpackage *pkg SETBUTNOTUSED(= NULL);
r = table_newpairedcursor(t->table, sourcename, version, &cursor,
&data, &datalen);
......@@ -592,6 +592,7 @@ retvalue tracking_remove(trackingdb t, const char *sourcename, const char *versi
result = parse_data(sourcename, version, data, datalen, &pkg);
if (RET_IS_OK(r)) {
assert (pkg != NULL);
r = references_delete(id, &pkg->filekeys, NULL);
RET_UPDATE(result, r);
trackedpackage_free(pkg);
......@@ -632,7 +633,7 @@ static void print(const char *codename, const struct trackedpackage *pkg){
retvalue tracking_printall(trackingdb t) {
struct cursor *cursor;
retvalue result, r;
struct trackedpackage *pkg IFSTUPIDCC(=NULL);
struct trackedpackage *pkg;
const char *key, *value, *data;
size_t datalen;
......@@ -660,7 +661,7 @@ retvalue tracking_foreach_ro(struct distribution *d, tracking_foreach_ro_action
trackingdb t;
struct cursor *cursor;
retvalue result, r;
struct trackedpackage *pkg IFSTUPIDCC(=NULL);
struct trackedpackage *pkg;
const char *key, *value, *data;
size_t datalen;
......@@ -1060,7 +1061,7 @@ retvalue trackingdata_finish(trackingdb tracks, struct trackingdata *d) {
retvalue tracking_tidyall(trackingdb t) {
struct cursor *cursor;
retvalue result, r;
struct trackedpackage *pkg IFSTUPIDCC(=NULL);
struct trackedpackage *pkg;
const char *key, *value, *data;
size_t datalen;
......@@ -1091,7 +1092,7 @@ retvalue tracking_tidyall(trackingdb t) {
retvalue tracking_reset(trackingdb t) {
struct cursor *cursor;
retvalue result, r;
struct trackedpackage *pkg IFSTUPIDCC(=NULL);
struct trackedpackage *pkg;
const char *key, *value, *data;
char *newdata;
size_t datalen, newdatalen;
......@@ -1130,7 +1131,7 @@ retvalue tracking_reset(trackingdb t) {
static retvalue tracking_foreachversion(trackingdb t, struct distribution *distribution, const char *sourcename, retvalue (action)(trackingdb t, struct trackedpackage *, struct distribution *)) {
struct cursor *cursor;
retvalue result, r;
struct trackedpackage *pkg IFSTUPIDCC(=NULL);
struct trackedpackage *pkg;
const char *value, *data;
size_t datalen;
......
......@@ -930,7 +930,7 @@ static retvalue getorigins(struct update_distribution *d) {
result = RET_NOTHING;
for (i = 0; i < distribution->updates.count ; i++) {
struct update_pattern *pattern = d->patterns[i];
struct update_origin *update IFSTUPIDCC(=NULL);
struct update_origin *update SETBUTNOTUSED(= NULL);
retvalue r;
if (pattern == NULL) {
......@@ -943,6 +943,7 @@ static retvalue getorigins(struct update_distribution *d) {
if (RET_WAS_ERROR(r))
break;
if (RET_IS_OK(r)) {
assert (update != NULL);
update->next = updates;
updates = update;
}
......@@ -1253,7 +1254,7 @@ retvalue updates_calcindices(struct update_pattern *patterns, struct distributio
for (distribution = distributions ; distribution != NULL ;
distribution = distribution->next) {
struct update_distribution *u_d;
struct update_pattern **translated_updates IFSTUPIDCC(= NULL);
struct update_pattern **translated_updates;
if (!distribution->selected)
continue;
......@@ -2117,7 +2118,7 @@ retvalue updates_update(struct update_distribution *distributions, bool nolistsd
retvalue result, r;
struct update_distribution *d;
struct downloadcache *cache;
struct aptmethodrun *run IFSTUPIDCC(=NULL);
struct aptmethodrun *run;
bool todo;
causingfile = NULL;
......@@ -2354,7 +2355,7 @@ static void updates_dumplist(struct update_distribution *distribution) {
retvalue updates_checkupdate(struct update_distribution *distributions, bool nolistsdownload, bool skipold) {
struct update_distribution *d;
retvalue result, r;
struct aptmethodrun *run IFSTUPIDCC(=NULL);
struct aptmethodrun *run;
result = updates_prepare(distributions, false, nolistsdownload, skipold,
&run);
......@@ -2387,7 +2388,7 @@ retvalue updates_checkupdate(struct update_distribution *distributions, bool nol
retvalue updates_dumpupdate(struct update_distribution *distributions, bool nolistsdownload, bool skipold) {
struct update_distribution *d;
retvalue result, r;
struct aptmethodrun *run IFSTUPIDCC(=NULL);
struct aptmethodrun *run;
result = updates_prepare(distributions, false, nolistsdownload, skipold,
&run);
......@@ -2419,7 +2420,7 @@ retvalue updates_dumpupdate(struct update_distribution *distributions, bool noli
retvalue updates_predelete(struct update_distribution *distributions, bool nolistsdownload, bool skipold) {
retvalue result, r;
struct update_distribution *d;
struct aptmethodrun *run IFSTUPIDCC(= NULL);
struct aptmethodrun *run;
causingfile = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment