Bug#318533: ftape-tools: FTBFS: Syntax error before '__FUNCTION__'

2005-07-24 Thread Roger Leigh
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_

Bug#318533: ftape-tools: FTBFS: Syntax error before '__FUNCTION__'

2005-07-22 Thread Roger Leigh
tags 318533 + patch
thanks

Hi,

A diff to fix the bug follows.  Unfortunately, I can't build it on my
big-endian powerpc system, so I'll have to rely on someone else to
build and test it.

Regards,
Roger


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-22 
18:11:41.092343104 +0100
@@ -437,7 +437,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 +445,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"));
@@ -845,7 +845,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;


Regards,
Roger

-- 
Roger Leigh
Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
Debian GNU/Linuxhttp://www.debian.org/
GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#318533: ftape-tools: FTBFS: Syntax error before '__FUNCTION__'

2005-07-15 Thread Daniel Schepler
Package: ftape-tools
Severity: serious
Version: 1:1.09.2002.03.21-0.3

>From my build log:

...
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../intl -I../../include/ftape 
-DLOCALEDIR=\"/usr/share/locale\"-g -O2 -c ftfmt-tapelib.c
In file included from ftfmt-tapelib.c:54:
ftformat.h:48: warning: 'packed' attribute ignored
ftformat.h:52: warning: 'packed' attribute ignored
ftfmt-tapelib.c: In function 'write_reference_burst':
ftfmt-tapelib.c:440: error: syntax error before '__FUNCTION__'
ftfmt-tapelib.c:448: error: syntax error before '__FUNCTION__'
ftfmt-tapelib.c: In function 'fill_dma_buffer':
ftfmt-tapelib.c:801: warning: incompatible implicit declaration of built-in 
function 'abort'
ftfmt-tapelib.c:807: error: invalid lvalue in assignment
ftfmt-tapelib.c:826: warning: incompatible implicit declaration of built-in 
function 'abort'
ftfmt-tapelib.c: In function 'format_cartridge':
ftfmt-tapelib.c:848: error: syntax error before string constant
make[4]: *** [ftfmt-tapelib.o] Error 1
make[4]: Leaving directory 
`/tmp/buildd/ftape-tools-1.09.2002.03.21/src/ftformat'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/buildd/ftape-tools-1.09.2002.03.21/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/buildd/ftape-tools-1.09.2002.03.21'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/tmp/buildd/ftape-tools-1.09.2002.03.21'
make: *** [build-stamp] Error 2

-- System Information:
Debian Release: testing/unstable
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-9-amd64-k8
Locale: LANG=en, LC_CTYPE=en (charmap=UTF-8) (ignored: LC_ALL set to 
en_US.UTF-8)

-- 
Daniel Schepler  "Please don't disillusion me.  I
[EMAIL PROTECTED]haven't had breakfast yet."
 -- Orson Scott Card


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]