summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--Makefile6
-rw-r--r--Makefile.inc6
-rw-r--r--isys/Makefile2
-rw-r--r--isys/gzlib/Makefile2
-rw-r--r--isys/gzlib/inflate.c2
-rw-r--r--isys/isys.c2
-rw-r--r--isys/lang.c2
-rw-r--r--isys/smp.c2
-rw-r--r--isys/uncpio.c8
-rw-r--r--loader2/Makefile16
-rw-r--r--loader2/driverdisk.c8
-rw-r--r--loader2/driverselect.c5
-rw-r--r--loader2/hdinstall.c8
-rw-r--r--loader2/init.c2
-rw-r--r--loader2/kickstart.c8
-rw-r--r--loader2/loader.c14
-rw-r--r--loader2/loadermisc.c2
-rw-r--r--loader2/moduleinfo.h3
-rw-r--r--loader2/modules.c4
-rw-r--r--loader2/net.c33
-rw-r--r--loader2/nfsinstall.c6
-rw-r--r--loader2/telnet.c2
-rw-r--r--loader2/undomounts.c2
-rw-r--r--loader2/urlinstall.c7
-rw-r--r--mini-wm.c4
-rw-r--r--utils/Makefile2
-rw-r--r--utils/genhdlist.c10
-rw-r--r--utils/mapshdr.c6
-rw-r--r--utils/snarffont.c12
-rw-r--r--xmouse.c8
-rw-r--r--xutils.c10
32 files changed, 121 insertions, 98 deletions
diff --git a/ChangeLog b/ChangeLog
index b393f440b..7115e64f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-06-13 Jeremy Katz <katzj@redhat.com>
+
+ * Makefile Makefile.inc mini-wm.c xmouse.c xutils.c isys/Makefile
+ isys/isys.c isys/lang.c isys/smp.c isys/uncpio.c
+ isys/gzlib/Makefile isys/gzlib/inflate.c loader2/Makefile
+ loader2/driverdisk.c loader2/driverselect.c loader2/hdinstall.c
+ loader2/init.c loader2/kickstart.c loader2/loader.c
+ loader2/loadermisc.c loader2/moduleinfo.h loader2/modules.c
+ loader2/net.c loader2/nfsinstall.c loader2/telnet.c
+ loader2/undomounts.c loader2/urlinstall.c utils/Makefile
+ utils/genhdlist.c utils/mapshdr.c utils/snarffont.c: Define cflags
+ in one place (Makefile.inc) and use a consistent set
+ everywhere. Fix up some of the compile warnings this uncovered.
+ Also fix a few more things that -Wextra turned up.
+
2005-06-07 Jeremy Katz <katzj@redhat.com>
* isys/lang.c (bterm_main): Use the full font first (#159505)
diff --git a/Makefile b/Makefile
index cdb054760..dbcd46520 100644
--- a/Makefile
+++ b/Makefile
@@ -27,14 +27,14 @@ locale-list:
PYTHONPATH="." $(PYTHON) scripts/genlocalelist.py > locale-list
mini-wm: mini-wm.c
- gcc -o mini-wm mini-wm.c `pkg-config gtk+-x11-2.0 --cflags --libs` -Wall -Werror -D_FORTIFY_SOURCE=2
+ gcc -o mini-wm mini-wm.c `pkg-config gtk+-x11-2.0 --cflags --libs`$(CFLAGS)
xmouse.so: xmouse.c
- gcc -Wall -o xmouse.o -fPIC -I/usr/X11R6/include -I$(PYTHONINCLUDE) -I $(PYTHONINCLUDE) -c xmouse.c -Wall -Werror -D_FORTIFY_SOURCE=2
+ gcc -Wall -o xmouse.o -fPIC -I/usr/X11R6/include -I$(PYTHONINCLUDE) -I $(PYTHONINCLUDE) -c xmouse.c $(CFLAGS)
gcc -o xmouse.so -shared xmouse.o -L/usr/X11R6/$(LIBDIR) -lXxf86misc -lX11 -lXext
xutils.so: xutils.c
- gcc -ggdb -Wall -o xutils.o -fPIC -I/usr/X11R6/include -I$(PYTHONINCLUDE) -I $(PYTHONINCLUDE) -c xutils.c -Wall -Werror -D_FORTIFY_SOURCE=2
+ gcc -ggdb -Wall -o xutils.o -fPIC -I/usr/X11R6/include -I$(PYTHONINCLUDE) -I $(PYTHONINCLUDE) -c xutils.c $(CFLAGS)
gcc -o xutils.so -shared xutils.o -ggdb -L/usr/X11R6/$(LIBDIR) -lX11
depend:
diff --git a/Makefile.inc b/Makefile.inc
index f8c05fa41..5cced1a02 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -23,3 +23,9 @@ USEDIET=0
ifeq (nosucharch, $(ARCH))
USEDIET=1
endif
+
+ifndef RPM_OPT_FLAGS
+RPM_OPT_FLAGS = -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
+endif
+
+CFLAGS = $(RPM_OPT_FLAGS) -Wall -Werror -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1
diff --git a/isys/Makefile b/isys/Makefile
index 12c4fd63b..4f305f3b8 100644
--- a/isys/Makefile
+++ b/isys/Makefile
@@ -1,6 +1,6 @@
include ../Makefile.inc
-CFLAGS = -ffunction-sections -I$(PYTHONINCLUDE) -I.. -Wall -Os -g -DHAVE_NFS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Werror -D_FORTIFY_SOURCE=2
+CFLAGS += -I$(PYTHONINCLUDE) -I.. -DHAVE_NFS
OBJECTS = nfsmount.o nfsmount_clnt.o nfsmount_xdr.o imount.o getmacaddr.o \
smp.o devnodes.o cpio.o uncpio.o dasd.o \
diff --git a/isys/gzlib/Makefile b/isys/gzlib/Makefile
index 9d081b901..f1ffab849 100644
--- a/isys/gzlib/Makefile
+++ b/isys/gzlib/Makefile
@@ -1,6 +1,6 @@
include ../../Makefile.inc
-CFLAGS += -I . -Os -fPIC -g -Wall -Werror -D_FORTIFY_SOURCE=2
+CFLAGS += -I . -fPIC
SOURCES = bits.c gzip.c inflate.c lzw.c trees.c unzip.c util.c zip.c binding.c \
deflate.c zip.c
OBJS = $(patsubst %.c,%.o,$(SOURCES))
diff --git a/isys/gzlib/inflate.c b/isys/gzlib/inflate.c
index 293aa1f34..ba58617bd 100644
--- a/isys/gzlib/inflate.c
+++ b/isys/gzlib/inflate.c
@@ -385,7 +385,7 @@ int *m; /* maximum lookup bits, returns actual */
w += l; /* previous table always l bits */
/* compute minimum size table less than or equal to l bits */
- z = (z = g - w) > (unsigned)l ? l : z; /* upper limit on table size */
+ z = (z = g - w) > (unsigned)l ? (unsigned)l : z; /* upper limit on table size */
if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
{ /* too few codes for k-w bit table */
f -= a + 1; /* deduct codes from patterns left */
diff --git a/isys/isys.c b/isys/isys.c
index 680279d70..6a08f7cb1 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -175,7 +175,7 @@ static PyMethodDef isysModuleMethods[] = {
{ "isWireless", (PyCFunction) isWireless, METH_VARARGS, NULL },
{ "biosDiskProbe", (PyCFunction) doProbeBiosDisks, METH_VARARGS,NULL},
{ "getbiosdisk",(PyCFunction) doGetBiosDisk, METH_VARARGS,NULL},
- { NULL }
+ { NULL, NULL, 0, NULL }
} ;
static PyObject * pyMakeDev(PyObject * s, PyObject * args) {
diff --git a/isys/lang.c b/isys/lang.c
index ee975f032..453176ebc 100644
--- a/isys/lang.c
+++ b/isys/lang.c
@@ -80,7 +80,7 @@ int loadKeymap(gzFile stream) {
struct kbentry entry;
int keymaps[MAX_NR_KEYMAPS];
int count = 0;
- int magic;
+ unsigned int magic;
short keymap[NR_KEYS];
struct stat sb;
diff --git a/isys/smp.c b/isys/smp.c
index de2239f62..8b7b25998 100644
--- a/isys/smp.c
+++ b/isys/smp.c
@@ -371,7 +371,7 @@ apic_probe( vm_offset_t* paddr, int* where )
* c rewrite of apic_probe() by Jack F. Vogel
*/
- int x;
+ unsigned int x;
uint16_t segment;
vm_offset_t target;
uint32_t buffer[ BIOS_SIZE / sizeof( int32_t ) ];
diff --git a/isys/uncpio.c b/isys/uncpio.c
index a3232c3c0..d27979b6c 100644
--- a/isys/uncpio.c
+++ b/isys/uncpio.c
@@ -79,7 +79,7 @@ struct cpioHeader {
gid_t gid;
int nlink;
time_t mtime;
- long size;
+ unsigned long size;
dev_t dev, rdev;
char * path;
};
@@ -304,7 +304,7 @@ static int expandRegular(struct ourfd * fd, struct cpioHeader * hdr,
int out;
char buf[8192];
int bytesRead;
- int left = hdr->size;
+ unsigned long left = hdr->size;
int rc = 0;
struct cpioCallbackInfo cbInfo;
struct stat sb;
@@ -449,9 +449,9 @@ static int createLinks(struct hardLink * li, const char ** failedFile) {
return 0;
}
-static int eatBytes(struct ourfd * fd, int amount) {
+static int eatBytes(struct ourfd * fd, unsigned long amount) {
char buf[4096];
- int bite;
+ unsigned long bite;
while (amount) {
bite = (amount > sizeof(buf)) ? sizeof(buf) : amount;
diff --git a/loader2/Makefile b/loader2/Makefile
index 54d6f4812..d71987df9 100644
--- a/loader2/Makefile
+++ b/loader2/Makefile
@@ -35,9 +35,7 @@ else
HWLIBS += -lpci
endif
-DEBUG = -ggdb
-COPTS = $(DEBUG) -Os -Wall -DUSE_LOGDEV -DVERSION='"$(VERSION)"' -Werror -D_FORTIFY_SOURCE=2
-CFLAGS = $(COPTS) -ffunction-sections -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBIO_H
+CFLAGS += -DUSE_LOGDEV -DVERSION='"$(VERSION)"'
STATIC = -static
REALCC=gcc
@@ -94,22 +92,22 @@ linuxrc.s390:
@echo "Nothing to do for $@"
init: init.o undomounts.o shutdown.o
- $(CC) $(STATIC) $(COPTS) $(LDFLAGS) -o $@ $^
+ $(CC) $(STATIC) $(CFLAGS) $(LDFLAGS) -o $@ $^
shutdown: shutdown.o undomounts.o
- $(CC) $(STATIC) $(COPTS) $(SHUTDOWNOPTS) $(LDFLAGS) -o $@ $^
+ $(CC) $(STATIC) $(CFLAGS) $(SHUTDOWNOPTS) $(LDFLAGS) -o $@ $^
init.o: init.c
- $(CC) $(COPTS) -c -o init.o init.c
+ $(CC) $(CFLAGS) -c -o init.o init.c
undomounts.o: undomounts.c
- $(CC) $(COPTS) -c -o undomounts.o undomounts.c
+ $(CC) $(CFLAGS) -c -o undomounts.o undomounts.c
shutdown.o: shutdown.c
- $(CC) $(COPTS) $(SHUTDOWNOPTS) -c -o shutdown.o shutdown.c
+ $(CC) $(CFLAGS) $(SHUTDOWNOPTS) -c -o shutdown.o shutdown.c
mkctype: mkctype.c
- $(REALCC) $(COPTS) -o mkctype mkctype.c
+ $(REALCC) $(CFLAGS) -o mkctype mkctype.c
ctype.c: mkctype
./mkctype > ctype.c
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index 66125ae91..e08995bc0 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -610,10 +610,10 @@ void useKickstartDD(struct loaderData_s * loaderData,
int rc;
int flags = *flagsPtr;
struct poptOption ksDDOptions[] = {
- { "type", '\0', POPT_ARG_STRING, &fstype, 0 },
- { "source", '\0', POPT_ARG_STRING, &src, 0 },
- { "biospart", '\0', POPT_ARG_NONE, &usebiosdev, 0 },
- { 0, 0, 0, 0, 0 }
+ { "type", '\0', POPT_ARG_STRING, &fstype, 0, NULL, NULL },
+ { "source", '\0', POPT_ARG_STRING, &src, 0, NULL, NULL },
+ { "biospart", '\0', POPT_ARG_NONE, &usebiosdev, 0, NULL, NULL },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
optCon = poptGetContext(NULL, argc, (const char **) argv, ksDDOptions, 0);
diff --git a/loader2/driverselect.c b/loader2/driverselect.c
index f2cc4a000..2d19ad82f 100644
--- a/loader2/driverselect.c
+++ b/loader2/driverselect.c
@@ -162,7 +162,7 @@ int chooseManualDriver(int class, moduleList modLoaded,
(class == CLASS_CDROM) || (class == CLASS_IDE))
type = DRIVER_SCSI;
else if (class == CLASS_UNSPEC)
- type = -1;
+ type = DRIVER_ANY;
else {
logMessage("unknown device class %d specified; aborting manual "
"selection", class);
@@ -176,7 +176,8 @@ int chooseManualDriver(int class, moduleList modLoaded,
for (i = 0; i < modInfo->numModules; i++) {
if (mlModuleInList(modInfo->moduleList[i].moduleName, modLoaded) ||
!modInfo->moduleList[i].description ||
- ((type != -1) && (type != modInfo->moduleList[i].major)))
+ ((type != DRIVER_ANY) &&
+ (type != modInfo->moduleList[i].major)))
continue;
sortedOrder[numSorted].index = i;
sortedOrder[numSorted++].modInfo = modInfo;
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index a99c41909..219511f75 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -456,10 +456,10 @@ void setKickstartHD(struct loaderData_s * loaderData, int argc,
int rc;
struct poptOption ksHDOptions[] = {
- { "biospart", '\0', POPT_ARG_STRING, &biospart, 0 },
- { "partition", '\0', POPT_ARG_STRING, &partition, 0 },
- { "dir", '\0', POPT_ARG_STRING, &dir, 0 },
- { 0, 0, 0, 0, 0 }
+ { "biospart", '\0', POPT_ARG_STRING, &biospart, 0, NULL, NULL },
+ { "partition", '\0', POPT_ARG_STRING, &partition, 0, NULL, NULL },
+ { "dir", '\0', POPT_ARG_STRING, &dir, 0, NULL, NULL },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
diff --git a/loader2/init.c b/loader2/init.c
index 91e19b1c9..8fb550c11 100644
--- a/loader2/init.c
+++ b/loader2/init.c
@@ -767,7 +767,7 @@ int main(int argc, char **argv) {
signal(SIGINT, sigintHandler);
if ((fd = open("/proc/sys/kernel/cad_pid", O_WRONLY)) != -1) {
char buf[7];
- int count;
+ size_t count;
sprintf(buf, "%d", getpid());
count = write(fd, buf, strlen(buf));
close(fd);
diff --git a/loader2/kickstart.c b/loader2/kickstart.c
index 197f4e4a8..aec7f633d 100644
--- a/loader2/kickstart.c
+++ b/loader2/kickstart.c
@@ -396,10 +396,10 @@ static void setShutdown(struct loaderData_s * loaderData, int argc,
int rc;
struct poptOption ksOptions[] = {
- { "reboot", 'r', POPT_ARG_NONE, &reboot, 0 },
- { "halt", 'h', POPT_ARG_NONE, &halt, 0 },
- { "poweroff", 'p', POPT_ARG_NONE, &poweroff, 0 },
- { 0, 0, 0, 0, 0 }
+ { "reboot", 'r', POPT_ARG_NONE, &reboot, 0, NULL, NULL },
+ { "halt", 'h', POPT_ARG_NONE, &halt, 0, NULL, NULL },
+ { "poweroff", 'p', POPT_ARG_NONE, &poweroff, 0, NULL, NULL },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
optCon = poptGetContext(NULL, argc, (const char **) argv, ksOptions, 0);
diff --git a/loader2/loader.c b/loader2/loader.c
index 7f341fc74..36672f169 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -1024,7 +1024,7 @@ static int manualDeviceCheck(moduleInfoSet modInfo, moduleList modLoaded,
char ** devices;
int i, j, rc, num = 0;
struct moduleInfo * mi;
- int width = 40;
+ unsigned int width = 40;
char * buf;
do {
@@ -1140,12 +1140,12 @@ int main(int argc, char ** argv) {
char * virtpcon = NULL;
poptContext optCon;
struct poptOption optionTable[] = {
- { "cmdline", '\0', POPT_ARG_STRING, &cmdLine, 0 },
- { "ksfile", '\0', POPT_ARG_STRING, &ksFile, 0 },
- { "test", '\0', POPT_ARG_NONE, &testing, 0 },
- { "mediacheck", '\0', POPT_ARG_NONE, &mediacheck, 0},
- { "virtpconsole", '\0', POPT_ARG_STRING, &virtpcon, 0 },
- { 0, 0, 0, 0, 0 }
+ { "cmdline", '\0', POPT_ARG_STRING, &cmdLine, 0, NULL, NULL },
+ { "ksfile", '\0', POPT_ARG_STRING, &ksFile, 0, NULL, NULL },
+ { "test", '\0', POPT_ARG_NONE, &testing, 0, NULL, NULL },
+ { "mediacheck", '\0', POPT_ARG_NONE, &mediacheck, 0, NULL, NULL},
+ { "virtpconsole", '\0', POPT_ARG_STRING, &virtpcon, 0, NULL, NULL },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
/* Make sure sort order is right. */
diff --git a/loader2/loadermisc.c b/loader2/loadermisc.c
index 276bf2f71..eab3dbb70 100644
--- a/loader2/loadermisc.c
+++ b/loader2/loadermisc.c
@@ -189,7 +189,7 @@ char * sdupprintf(const char *format, ...) {
char *buf = NULL;
char c;
va_list args;
- size_t size = 0;
+ int size = 0;
va_start(args, format);
diff --git a/loader2/moduleinfo.h b/loader2/moduleinfo.h
index 8c6bd3966..6c719a6bc 100644
--- a/loader2/moduleinfo.h
+++ b/loader2/moduleinfo.h
@@ -2,7 +2,8 @@
#define MODULEINFO_H
enum driverMajor { DRIVER_NONE = 0, DRIVER_SCSI, DRIVER_NET, DRIVER_CDROM,
- DRIVER_PCMCIA, DRIVER_FS, DRIVER_IDE, DRIVER_OTHER = 1000};
+ DRIVER_PCMCIA, DRIVER_FS, DRIVER_IDE, DRIVER_OTHER = 1000,
+ DRIVER_ANY = 5000 };
enum driverMinor { DRIVER_MINOR_NONE = 0, DRIVER_MINOR_ETHERNET,
DRIVER_MINOR_PLIP, DRIVER_MINOR_TR };
diff --git a/loader2/modules.c b/loader2/modules.c
index 6d9760ec3..d190b153a 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -971,8 +971,8 @@ void loadKickstartModule(struct loaderData_s * loaderData, int argc,
int rc;
int flags = *flagsPtr;
struct poptOption ksDeviceOptions[] = {
- { "opts", '\0', POPT_ARG_STRING, &opts, 0 },
- { 0, 0, 0, 0, 0 }
+ { "opts", '\0', POPT_ARG_STRING, &opts, 0, NULL, NULL },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
optCon = poptGetContext(NULL, argc, (const char **) argv,
diff --git a/loader2/net.c b/loader2/net.c
index 39a90bfce..cc4b5a2a5 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -850,21 +850,21 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
poptContext optCon;
struct poptOption ksOptions[] = {
- { "bootproto", '\0', POPT_ARG_STRING, &bootProto, 0 },
- { "device", '\0', POPT_ARG_STRING, &device, 0 },
- { "dhcpclass", '\0', POPT_ARG_STRING, &class, 0 },
- { "gateway", '\0', POPT_ARG_STRING, NULL, 'g' },
- { "ip", '\0', POPT_ARG_STRING, NULL, 'i' },
- { "nameserver", '\0', POPT_ARG_STRING, NULL, 'n' },
- { "netmask", '\0', POPT_ARG_STRING, NULL, 'm' },
- { "nodns", '\0', POPT_ARG_NONE, &noDns, 0 },
- { "hostname", '\0', POPT_ARG_STRING, NULL, 'h'},
- { "ethtool", '\0', POPT_ARG_STRING, &ethtool, 0 },
- { "essid", '\0', POPT_ARG_STRING, &essid, 0 },
- { "wepkey", '\0', POPT_ARG_STRING, &wepkey, 0 },
- { "onboot", '\0', POPT_ARG_STRING, &onboot, 0 },
- { "notksdevice", '\0', POPT_ARG_NONE, &noksdev, 0 },
- { 0, 0, 0, 0, 0 }
+ { "bootproto", '\0', POPT_ARG_STRING, &bootProto, 0, NULL, NULL },
+ { "device", '\0', POPT_ARG_STRING, &device, 0, NULL, NULL },
+ { "dhcpclass", '\0', POPT_ARG_STRING, &class, 0, NULL, NULL },
+ { "gateway", '\0', POPT_ARG_STRING, NULL, 'g', NULL, NULL },
+ { "ip", '\0', POPT_ARG_STRING, NULL, 'i', NULL, NULL },
+ { "nameserver", '\0', POPT_ARG_STRING, NULL, 'n', NULL, NULL },
+ { "netmask", '\0', POPT_ARG_STRING, NULL, 'm', NULL, NULL },
+ { "nodns", '\0', POPT_ARG_NONE, &noDns, 0, NULL, NULL },
+ { "hostname", '\0', POPT_ARG_STRING, NULL, 'h', NULL, NULL},
+ { "ethtool", '\0', POPT_ARG_STRING, &ethtool, 0, NULL, NULL },
+ { "essid", '\0', POPT_ARG_STRING, &essid, 0, NULL, NULL },
+ { "wepkey", '\0', POPT_ARG_STRING, &wepkey, 0, NULL, NULL },
+ { "onboot", '\0', POPT_ARG_STRING, &onboot, 0, NULL, NULL },
+ { "notksdevice", '\0', POPT_ARG_NONE, &noksdev, 0, NULL, NULL },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
optCon = poptGetContext(NULL, argc, (const char **) argv,
@@ -964,7 +964,8 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
/* NOTE - uses kickstart data available in loaderData */
int chooseNetworkInterface(struct loaderData_s * loaderData,
int flags) {
- int i, rc, max = 40;
+ int i, rc;
+ unsigned int max = 40;
int deviceNums = 0;
int deviceNum;
char ** devices;
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 9b5d5593e..6a702d0e6 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -236,9 +236,9 @@ void setKickstartNfs(struct loaderData_s * loaderData, int argc,
poptContext optCon;
int rc;
struct poptOption ksNfsOptions[] = {
- { "server", '\0', POPT_ARG_STRING, &host, 0 },
- { "dir", '\0', POPT_ARG_STRING, &dir, 0 },
- { 0, 0, 0, 0, 0 }
+ { "server", '\0', POPT_ARG_STRING, &host, 0, NULL, NULL },
+ { "dir", '\0', POPT_ARG_STRING, &dir, 0, NULL, NULL },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
logMessage("kickstartFromNfs");
diff --git a/loader2/telnet.c b/loader2/telnet.c
index 473acfeb4..28946000d 100644
--- a/loader2/telnet.c
+++ b/loader2/telnet.c
@@ -119,7 +119,7 @@ telnet_negotiate(int socket, char ** term_type_ptr, int * heightPtr,
termType[termLength++] = tolower(ch);
} else if (state == ST_WINDOWSIZE) {
- if ((sizePtr - sizeBuf) < sizeof(sizeBuf))
+ if ((sizePtr - sizeBuf) < (int)sizeof(sizeBuf))
*sizePtr++ = ch;
}
diff --git a/loader2/undomounts.c b/loader2/undomounts.c
index 92d8cdbb4..d562837ea 100644
--- a/loader2/undomounts.c
+++ b/loader2/undomounts.c
@@ -48,7 +48,7 @@ static void printstr(char * string) {
}
void undoMount(struct unmountInfo * fs, int numFs, int this) {
- int len = strlen(fs[this].name);
+ size_t len = strlen(fs[this].name);
int i;
if (!fs[this].mounted) return;
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index c344086a0..701b83093 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -372,7 +372,8 @@ int getFileFromUrl(char * url, char * dest,
ehdrs = NULL;
if (proto == URL_METHOD_HTTP && FL_KICKSTART_SEND_MAC(flags)) {
/* find all ethernet devices and make a header entry for each one */
- int i, hdrlen;
+ int i;
+ unsigned int hdrlen;
char *dev, *mac, tmpstr[128];
struct device ** devices;
@@ -431,8 +432,8 @@ void setKickstartUrl(struct loaderData_s * loaderData, int argc,
poptContext optCon;
int rc;
struct poptOption ksUrlOptions[] = {
- { "url", '\0', POPT_ARG_STRING, &url, 0 },
- { 0, 0, 0, 0, 0 }
+ { "url", '\0', POPT_ARG_STRING, &url, 0, NULL, NULL },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
logMessage("kickstartFromUrl");
diff --git a/mini-wm.c b/mini-wm.c
index e2bbe9d4b..c388d4d1a 100644
--- a/mini-wm.c
+++ b/mini-wm.c
@@ -16,6 +16,7 @@
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <gdk/gdkx.h>
@@ -100,14 +101,13 @@ mini_wm_start (void)
int main( int argc,
char *argv[] )
{
-
gtk_init (&argc, &argv);
mini_wm_start ();
/* Indicate back to anaconda that we now have established
* connection to the display. */
- write(1, "#", 1);
+ if (write(1, "#", 1) == -1) abort();
gtk_main();
diff --git a/utils/Makefile b/utils/Makefile
index 93e06c9ae..bf0704c6e 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -7,7 +7,7 @@ ISYSLIB=isys
LOADERDIR = ../loader2
LOADLIBES = -lpopt
-CFLAGS = -Wall -g -I.. -I$(LOADERDIR) -Werror -D_FORTIFY_SOURCE=2
+CFLAGS += -I.. -I$(LOADERDIR) -fno-strict-aliasing
RPMCFLAGS = $(CFLAGS) -I/usr/include/rpm
LDFLAGS = -g
diff --git a/utils/genhdlist.c b/utils/genhdlist.c
index 3ad6f953b..3055d7c7e 100644
--- a/utils/genhdlist.c
+++ b/utils/genhdlist.c
@@ -170,7 +170,7 @@ int onePrePass(const char * dirName) {
return 1;
}
- chdir(subdir);
+ if (chdir(subdir) == -1) abort();
errno = 0;
ent = readdir(dir);
@@ -227,7 +227,7 @@ int onePass(FD_t outfd, FD_t out2fd, const char * dirName, int cdNum,
struct dirent * ent;
char * subdir = strdup(dirName);
int errno;
- Header h, nh, h2;
+ Header h, nh, h2 = NULL;
int rc;
int_32 size;
DIR * dir;
@@ -237,7 +237,7 @@ int onePass(FD_t outfd, FD_t out2fd, const char * dirName, int cdNum,
int order = -1;
char ** newFileList, ** fileNames;
uint_32 * newFileFlags, * fileFlags;
- int newFileListCount;
+ int newFileListCount = 0;
int marker = time(NULL); /* good enough counter; we'll increment it */
rpmts ts = rpmtsCreate();
rpmtsSetRootDir(ts, "/");
@@ -251,7 +251,7 @@ int onePass(FD_t outfd, FD_t out2fd, const char * dirName, int cdNum,
return 1;
}
- chdir(subdir);
+ if (chdir(subdir) == -1) abort();
errno = 0;
ent = readdir(dir);
@@ -376,7 +376,7 @@ int onePass(FD_t outfd, FD_t out2fd, const char * dirName, int cdNum,
if (headerGetEntry(h, RPMTAG_OLDFILENAMES, NULL,
(void **) &fileNames, &fileCount)) {
headerGetEntry(h, RPMTAG_FILEFLAGS, NULL,
- (void **) &fileFlags, NULL);
+ (void **) &fileFlags, NULL);
newFileList = malloc(sizeof(*newFileList) * fileCount);
newFileFlags = malloc(sizeof(*newFileList) * fileCount);
diff --git a/utils/mapshdr.c b/utils/mapshdr.c
index 53f99b8c5..5a8d18f59 100644
--- a/utils/mapshdr.c
+++ b/utils/mapshdr.c
@@ -10,13 +10,13 @@
int main(int argc, char ** argv) {
struct kmapHeader h;
struct kmapInfo info;
- int i;
+ int i, x;
struct stat sb;
char * chptr;
h.magic = KMAP_MAGIC;
h.numEntries = argc - 1;
- write(1, &h, sizeof(h));
+ x = write(1, &h, sizeof(h));
for (i = 1; i < argc; i++) {
if (stat(argv[i], &sb)) {
@@ -33,7 +33,7 @@ int main(int argc, char ** argv) {
*chptr = '\0';
info.size = sb.st_size;
- write(1, &info, sizeof(info));
+ x = write(1, &info, sizeof(info));
}
return 0;
diff --git a/utils/snarffont.c b/utils/snarffont.c
index d6597526c..eaff9ccf9 100644
--- a/utils/snarffont.c
+++ b/utils/snarffont.c
@@ -19,7 +19,7 @@ int main(void) {
unsigned short map[E_TABSZ];
struct unipair descs[2048];
struct unimapdesc d;
- int fd;
+ int fd, i;
if ((fd = open("/dev/tty0", O_RDONLY)) < 0)
die("open");
@@ -41,10 +41,10 @@ int main(void) {
if (ioctl(fd, GIO_UNIMAP, &d))
die("GIO_UNIMAP");
- write(1, &cfo, sizeof(cfo));
- write(1, buf, sizeof(buf));
- write(1, map, sizeof(map));
- write(1, &d.entry_ct, sizeof(d.entry_ct));
- write(1, descs, d.entry_ct * sizeof(descs[0]));
+ i = write(1, &cfo, sizeof(cfo));
+ i = write(1, buf, sizeof(buf));
+ i = write(1, map, sizeof(map));
+ i = write(1, &d.entry_ct, sizeof(d.entry_ct));
+ i = write(1, descs, d.entry_ct * sizeof(descs[0]));
return 0;
}
diff --git a/xmouse.c b/xmouse.c
index a625b2bc8..0cf5ce301 100644
--- a/xmouse.c
+++ b/xmouse.c
@@ -40,10 +40,10 @@ static PyObject * mouse_reopen (PyObject * s, PyObject * args);
static PyObject * mouse_set (PyObject * s, PyObject * args);
static PyMethodDef xmouseMethods[] = {
- { "get", mouse_get, 1 },
- { "reopen", mouse_reopen, 1 },
- { "set", mouse_set, 1 },
- { NULL, NULL }
+ { "get", mouse_get, 1, NULL },
+ { "reopen", mouse_reopen, 1, NULL },
+ { "set", mouse_set, 1, NULL },
+ { NULL, NULL, 0, NULL }
};
static int miscError(Display *disp, XErrorEvent *err)
diff --git a/xutils.c b/xutils.c
index ed30af4fd..abf625e37 100644
--- a/xutils.c
+++ b/xutils.c
@@ -25,11 +25,11 @@ static PyObject * screenHeight (PyObject * s, PyObject * args);
static PyObject * screenWidth (PyObject * s, PyObject * args);
static PyMethodDef xutilsMethods[] = {
- { "getRootResources", getRootResources, 1 },
- { "setRootResource", setRootResource, 1 },
- { "screenHeight", screenHeight, 1 },
- { "screenWidth", screenWidth, 1 },
- { NULL, NULL }
+ { "getRootResources", getRootResources, 1, NULL },
+ { "setRootResource", setRootResource, 1, NULL },
+ { "screenHeight", screenHeight, 1, NULL },
+ { "screenWidth", screenWidth, 1, NULL },
+ { NULL, NULL, 0, NULL }
};
typedef struct _Resource {