From 789580d13591ff1aa53cfbf5fef4d46b0b65c805 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 9 Oct 2009 10:17:43 -0500 Subject: [PATCH] Fix warnings in butc, tbutc, and butm tbutc: - Ignore warnings for dump.c butc/dump.c: - butm_WriteFileData takes a char*, no need to cast buffer - volumeHeader_hton takes a struct volumeHeader*, though, need to cast buffer there - Ignore strict prototypes butc/recoverDb.c: - scanVolData takes a uint*, not an int* - Initialize nbytes to 0 - Remove warning inhibition butc/tcmain.c: - atocl takes an int*, not a uint* - Ignore implicit function declaration warnings butc/tcudbprocs.c: - Ignore implicit function declaration warnings (ubik stuff) butm/file_tm.c: - Include sys/wait.h for the waitpid() prototype Reviewed-on: http://gerrit.openafs.org/635 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/butc/Makefile.in | 1 - src/butc/dump.c | 7 +++++-- src/butc/recoverDb.c | 3 ++- src/butc/tcmain.c | 7 +++++-- src/butc/tcudbprocs.c | 3 +++ src/butm/file_tm.c | 1 + src/tbutc/Makefile.in | 2 +- 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/butc/Makefile.in b/src/butc/Makefile.in index 4ede693b5..025caf5e6 100644 --- a/src/butc/Makefile.in +++ b/src/butc/Makefile.in @@ -76,7 +76,6 @@ lwps.o: lwps.c ${INCLS} $(CC) $(CFLAGS) -c $< list.o: list.c ${INCLS} recoverDb.o: recoverDb.c ${INCLS} - $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $< tcudbprocs.o: tcudbprocs.c ${INCLS} $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $< dump.o: dump.c ${INCLS} diff --git a/src/butc/dump.c b/src/butc/dump.c index 5a1228c2c..1b104e309 100644 --- a/src/butc/dump.c +++ b/src/butc/dump.c @@ -10,6 +10,9 @@ #include #include +#ifdef IGNORE_SOME_GCC_WARNINGS +# pragma GCC diagnostic warning "-Wstrict-prototypes" +#endif #include #ifdef AFS_NT40_ENV @@ -301,7 +304,7 @@ dumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr) hostVolumeHeader.contd = ((fragmentNumber == 1) ? 0 : TC_VOLCONTD); volumeHeader_hton(&hostVolumeHeader, (struct volumeHeader *)buffer); - rc = butm_WriteFileData(tapeInfoPtr, (struct volumeHeader *)buffer, 1, + rc = butm_WriteFileData(tapeInfoPtr, buffer, 1, sizeof(hostVolumeHeader)); if (rc) { ErrorLog(1, taskId, rc, tapeInfoPtr->error, @@ -393,7 +396,7 @@ dumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr) hostVolumeHeader.contd = (endofvolume ? 0 : TC_VOLCONTD); hostVolumeHeader.magic = TC_VOLENDMAGIC; hostVolumeHeader.endTime = (endofvolume ? time(0) : 0); - volumeHeader_hton(&hostVolumeHeader, &buffer[bytesread]); + volumeHeader_hton(&hostVolumeHeader, (struct volumeHeader *)&buffer[bytesread]); bytesread += sizeof(hostVolumeHeader); } diff --git a/src/butc/recoverDb.c b/src/butc/recoverDb.c index 67df0b257..83e6e3075 100644 --- a/src/butc/recoverDb.c +++ b/src/butc/recoverDb.c @@ -338,7 +338,8 @@ readDump(afs_uint32 taskId, struct butm_tapeInfo *tapeInfoPtr, struct tapeScanInfo *scanInfoPtr) { int moreTapes = 1; - afs_int32 nbytes, flags, seq; + afs_int32 flags, seq; + afs_uint32 nbytes = 0; int newDump = 1, newTape = 1; afs_int32 tapePosition; afs_int32 code = 0, tcode; diff --git a/src/butc/tcmain.c b/src/butc/tcmain.c index 1b485368a..87672bf40 100644 --- a/src/butc/tcmain.c +++ b/src/butc/tcmain.c @@ -10,6 +10,9 @@ #include #include +#ifdef IGNORE_SOME_GCC_WARNINGS +# pragma GCC diagnostic warning "-Wimplicit-function-declaration" +#endif #include #include @@ -325,8 +328,8 @@ GetDeviceConfig(char *filename, struct tapeConfig *config, afs_int32 portOffset) char devName[LINESIZE], tcapacity[LINESIZE], tfmsize[LINESIZE], trest[LINESIZE]; afs_int32 aport; - afs_uint32 capacity; - afs_uint32 fmSize; + afs_int32 capacity; + afs_int32 fmSize; afs_int32 code = 0, count; /* Initialize the config struct */ diff --git a/src/butc/tcudbprocs.c b/src/butc/tcudbprocs.c index 3b285ae26..b358194ce 100644 --- a/src/butc/tcudbprocs.c +++ b/src/butc/tcudbprocs.c @@ -10,6 +10,9 @@ #include #include +#ifdef IGNORE_SOME_GCC_WARNINGS +# pragma GCC diagnostic warning "-Wimplicit-function-declaration" +#endif #include #ifdef AFS_NT40_ENV diff --git a/src/butm/file_tm.c b/src/butm/file_tm.c index 7a84d1749..c85a11b59 100644 --- a/src/butm/file_tm.c +++ b/src/butm/file_tm.c @@ -17,6 +17,7 @@ #include #endif #include +#include #include #include #include diff --git a/src/tbutc/Makefile.in b/src/tbutc/Makefile.in index 43f36c9a6..f97977253 100644 --- a/src/tbutc/Makefile.in +++ b/src/tbutc/Makefile.in @@ -102,7 +102,7 @@ tcudbprocs.o: ${BUTC}/tcudbprocs.c ${BUTCINCLS} ${CC} ${CFLAGS} -c ${BUTC}/tcudbprocs.c dump.o: ${BUTC}/dump.c ${BUTCINCLS} - ${CC} ${CFLAGS} -c ${BUTC}/dump.c + ${CC} ${CFLAGS} @CFLAGS_NOERROR@ -c ${BUTC}/dump.c tcstatus.o: ${BUTC}/tcstatus.c ${BUTCINCLS} ${CC} ${CFLAGS} -c ${BUTC}/tcstatus.c -- 2.39.5