The following patch fixes all the GCC 4.0 build errors. However, it
does need testing by an ftape user (to check old tapes still
read--there were some struct packing issues).
Regards,
Roger
diff -urN ftape-tools-1.09.2002.03.21.original/debian/changelog
ftape-tools-1.09.2002.03.21/debian/changelog
--- ftape-tools-1.09.2002.03.21.original/debian/changelog 2005-07-24
12:10:54.0 +0100
+++ ftape-tools-1.09.2002.03.21/debian/changelog2005-07-24
14:13:45.0 +0100
@@ -1,3 +1,28 @@
+ftape-tools (1:1.09.2002.03.21-0.4) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Fix several GCC 4.0 incompatibilies (Closes: #318533).
+- src/ftformat/ftfmt-options.c: struct opt_parms.label is a
+ "u_int8_t *"; add appropriate typecasts.
+- /src/ftformat/ftfmt-tapelib.c:
+ + Replace the use of the non-standard preprocessor macro
+__FUNCTION__ with the C99 __func__.
+ + Include missing .
+- src/ftformat/ftformat.c:
+ + Include missing .
+ + Add "char *" casts to quell signedness warnings.
+- src/ftformat/ftformat.h, src/vtblc/ftvt.h: "__attribute__ ((packed))"
+ must come immediately after the end of the struct definition, not
+ after the typedef name.
+- src/vtblc/libftvt.c:
+ + Add "char *" casts to quell signedness warnings.
+ + Add GET_SINGLE_BITFIELD_VALUE_ACTION and GET_SINGLE_BITFIELD_VALUE
+macros to replace the use of GET_SINGLE_VALUE_ACTION and
+GET_SINGLE_VALUE for bitfield values in structs. The latter
+use the GCC typeof extension, which does not work with bifields.
+
+ -- Roger Leigh <[EMAIL PROTECTED]> Sun, 24 Jul 2005 14:13:33 +0100
+
ftape-tools (1:1.09.2002.03.21-0.3) unstable; urgency=low
* Uploading with maintainer set to QA group
diff -urN ftape-tools-1.09.2002.03.21.original/src/ftformat/ftfmt-options.c
ftape-tools-1.09.2002.03.21/src/ftformat/ftfmt-options.c
--- ftape-tools-1.09.2002.03.21.original/src/ftformat/ftfmt-options.c
2000-07-23 14:55:40.0 +0100
+++ ftape-tools-1.09.2002.03.21/src/ftformat/ftfmt-options.c2005-07-24
12:59:34.0 +0100
@@ -51,7 +51,7 @@
#include "version.h"
struct opt_parms opt = {
-FTAPE_DEF_LABEL,
+(u_int8_t *) FTAPE_DEF_LABEL,
FTAPE_DEF_TAPE,
FT_BUFF_SIZE * NR_FTAPE_BUFFERS,
AUTO,
@@ -311,7 +311,7 @@
}
break;
case 'L':
- opt.label = optarg;
+ opt.label = (u_int8_t *) optarg;
break;
case 'M':
opt.dma_size = strtol(optarg, NULL, 0);
diff -urN ftape-tools-1.09.2002.03.21.original/src/ftformat/ftfmt-tapelib.c
ftape-tools-1.09.2002.03.21/src/ftformat/ftfmt-tapelib.c
--- ftape-tools-1.09.2002.03.21.original/src/ftformat/ftfmt-tapelib.c
2000-07-23 23:47:59.0 +0100
+++ ftape-tools-1.09.2002.03.21/src/ftformat/ftfmt-tapelib.c2005-07-24
12:18:25.0 +0100
@@ -36,6 +36,7 @@
#define MAP_FAILED (void *)(-1)
#endif
#include
+#include
#include
#include
#include
@@ -437,7 +438,7 @@
printf(_("Writing reference bursts ... "));
if (qic_simple_command(tape_fd, 0, QIC_ENTER_FORMAT_MODE, -1, 0, NULL)) {
- fprintf(stderr, "\n"__FUNCTION__ " %s", _("failed!\n"));
+ fprintf(stderr, "\n%s %s", __func__, _("failed!\n"));
return -1;
}
if (qic_simple_command(tape_fd, 0, QIC_WRITE_REFERENCE_BURST, -1, 940,
@@ -445,7 +446,7 @@
return -1;
}
if (!(status & QIC_STATUS_REFERENCED)) {
- fprintf(stderr, "\n"__FUNCTION__ " %s", _("failed!\n"));
+ fprintf(stderr, "\n%s %s", __func__, _("failed!\n"));
return -1;
}
printf(_("done.\n"));
@@ -804,7 +805,8 @@
}
if (buf_pos == buf_end) { /* cycle */
msync_offset = 0; /* reset to start of buffer */
- buf_start = (void*) buf_pos = buf;
+ buf_pos = buf;
+ buf_start = (void*) buf_pos;
}
}
/* We only sync after computing enough parameters for an entire page,
@@ -845,7 +847,7 @@
struct mtftformat_virtual fmtc;
if (qic_simple_command(tape_fd, 0, QIC_ENTER_FORMAT_MODE, -1, 0, NULL)) {
- fprintf(stderr, __FUNCTION__ " %s", _("failed!\n"));
+ fprintf(stderr, "%s %s", __func__, _("failed!\n"));
return -1;
}
trk = 0;
diff -urN ftape-tools-1.09.2002.03.21.original/src/ftformat/ftformat.c
ftape-tools-1.09.2002.03.21/src/ftformat/ftformat.c
--- ftape-tools-1.09.2002.03.21.original/src/ftformat/ftformat.c
2002-03-21 22:00:14.0 +
+++ ftape-tools-1.09.2002.03.21/src/ftformat/ftformat.c 2005-07-24
13:00:26.0 +0100
@@ -31,6 +31,7 @@
#include
#include
+#include
#include
#include
#include
@@ -202,7 +203,7 @@
exit (1);
}
-if (compose_header_segment(hseg, opts.label, &tpparms)) {
+if (compose_header_segment(hseg, (char *) opts.label, &tpparms)) {
tape_close(tape_fd, dma_buffer, opts.dma_