Bug#464384: elinks_0.12~20080127-1(experimental/amd64/xenophanes): -Werror, warning: cast from pointer to integer of different size

2008-02-13 Thread Y Giridhar Appaji Nag
On 08/02/10 20:55 +0530, Y Giridhar Appaji Nag said ...
 builds should go through fine now I suppose.  I had them tested
 atleast on amd64 and powerpc.  I'll request an upload.

Hopefully around the weekend, I'll be added to the DM keyring and we
will do an upload after an initial DM-Upload-Allowed: yes upload is
done.

Giridhar

-- 
Y Giridhar Appaji Nag | http://www.appaji.net/


signature.asc
Description: Digital signature


Bug#464384: elinks_0.12~20080127-1(experimental/amd64/xenophanes): -Werror, warning: cast from pointer to integer of different size

2008-02-10 Thread Kalle Olavi Niemitalo
Y Giridhar Appaji Nag [EMAIL PROTECTED] quotes:

 make[4]: Entering directory 
 `/tmp/buildd/elinks-0.12~20080127/build-main/src/protocol/smb'
   [CC]   src/protocol/smb/smb2.o
 cc1: warnings being treated as errors
 /tmp/buildd/elinks-0.12~20080127/src/protocol/smb/smb2.c: In function 
 'do_smb':
 /tmp/buildd/elinks-0.12~20080127/src/protocol/smb/smb2.c:352: warning: format 
 '%lld' expects type 'long long int', but argument 3 has type '__off_t'
 make[4]: *** [smb2.o] Error 1

Thank you.  I pushed the following patch, which should fix these.

Debian bug 464384: fix OFF_T_FORMAT mismatches on amd64

On AMD64 apparently, off_t is long but ELinks detected SIZEOF_OFF_T == 8
and defined OFF_T_FORMAT as lld, which expects long long and so causes
GCC to warn about a mismatching format specifier.  Because --enable-debug
adds -Werror to $CFLAGS, this warning breaks the build.  When both
SIZEOF_LONG and SIZEOF_LONG_LONG are 8, ELinks cannot know which type
it should use.

To fix this, do not attempt to find a format specifier for off_t itself.
Instead cast all printed off_t values to a new typedef off_print_T that
is large enough, and replace OFF_T_FORMAT with OFF_PRINT_FORMAT which
is suitable for off_print_T altough not necessarily for off_t.  ELinks
already had a similar scheme with time_print_T and TIME_PRINT_FORMAT.

---
commit 61019c31304f89141248b0381974d1e3886cf160
tree a3343d1895bfd6892bbc6cf275930c513a508bec
parent 6555359f8e56b6e08bd1a8f40fd363506a0e3ff5
author Kalle Olavi Niemitalo [EMAIL PROTECTED] Sun, 10 Feb 2008 11:20:33 +0200
committer Kalle Olavi Niemitalo [EMAIL PROTECTED] Sun, 10 Feb 2008 11:30:27 
+0200

 src/cache/cache.c   |8 +---
 src/cache/dialogs.c |8 
 src/dialogs/document.c  |5 +++--
 src/osdep/types.h   |   22 +-
 src/protocol/fsp/fsp.c  |3 ++-
 src/protocol/ftp/ftp.c  |3 ++-
 src/protocol/smb/smb2.c |3 ++-
 7 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/src/cache/cache.c b/src/cache/cache.c
index db9efe1..8b05080 100644
--- a/src/cache/cache.c
+++ b/src/cache/cache.c
@@ -40,9 +40,11 @@ static void truncate_entry(struct cache_entry *cached, off_t 
offset, int final);
 
 #define dump_frag(frag, count) \
 do { \
-   DBG( [%d] f=%p offset=% OFF_T_FORMAT  length=% OFF_T_FORMAT \
-real_length=% OFF_T_FORMAT, \
-   count, frag, frag-offset, frag-length, frag-real_length); \
+   DBG( [%d] f=%p offset=% OFF_PRINT_FORMAT \
+length=% OFF_PRINT_FORMAT \
+real_length=% OFF_PRINT_FORMAT, \
+   count, frag, (off_print_T) frag-offset, \
+   (off_print_T) frag-length, (off_print_T) frag-real_length); \
 } while (0)
 
 #define dump_frags(entry, comment) \
diff --git a/src/cache/dialogs.c b/src/cache/dialogs.c
index b0a33b3..29a9446 100644
--- a/src/cache/dialogs.c
+++ b/src/cache/dialogs.c
@@ -82,10 +82,10 @@ get_cache_entry_info(struct listbox_item *item, struct 
terminal *term)
}
}
 
-   add_format_to_string(msg, \n%s: % OFF_T_FORMAT, _(Size, term),
-cached-length);
-   add_format_to_string(msg, \n%s: % OFF_T_FORMAT, _(Loaded size, 
term),
-   cached-data_size);
+   add_format_to_string(msg, \n%s: % OFF_PRINT_FORMAT, _(Size, term),
+(off_print_T) cached-length);
+   add_format_to_string(msg, \n%s: % OFF_PRINT_FORMAT, _(Loaded size, 
term),
+(off_print_T) cached-data_size);
if (cached-content_type) {
add_format_to_string(msg, \n%s: %s, _(Content type, term),
 cached-content_type);
diff --git a/src/dialogs/document.c b/src/dialogs/document.c
index ba55ea2..458e839 100644
--- a/src/dialogs/document.c
+++ b/src/dialogs/document.c
@@ -152,8 +152,9 @@ document_info_dialog(struct session *ses)
if (cached) {
unsigned char *a;
 
-   add_format_to_string(msg, \n%s: % OFF_T_FORMAT,
-_(Size, term), cached-length);
+   add_format_to_string(msg, \n%s: % OFF_PRINT_FORMAT,
+_(Size, term),
+(off_print_T) cached-length);
 
if (cached-incomplete) {
add_format_to_string(msg,  (%s), _(incomplete, 
term));
diff --git a/src/osdep/types.h b/src/osdep/types.h
index 2404ac0..f1c42f8 100644
--- a/src/osdep/types.h
+++ b/src/osdep/types.h
@@ -146,12 +146,24 @@ typedef unsigned long long uint32_t;
  */
 typedef long longptr_T;
 
-/* Define internal off_t format macro for printing variables. */
-#if HAVE_OFF_T == 1  SIZEOF_OFF_T == 8
-#define OFF_T_FORMAT lld
+/* To print off_t offset, ELinks does:
+ *
+ * printf(% OFF_PRINT_FORMAT, (off_print_T) offset);
+ *
+ * The cast is necessary because it is not possible to guess
+ * a printf format for off_t itself 

Bug#464384: elinks_0.12~20080127-1(experimental/amd64/xenophanes): -Werror, warning: cast from pointer to integer of different size

2008-02-10 Thread Y Giridhar Appaji Nag
On 08/02/10 11:37 +0200, Kalle Olavi Niemitalo said ...
 Thank you.  I pushed the following patch, which should fix these.
 
 commit 61019c31304f89141248b0381974d1e3886cf160

Thank you KON.  I pushed changes based on these to alioth git.  The
builds should go through fine now I suppose.  I had them tested atleast
on amd64 and powerpc.  I'll request an upload.

Giridhar

-- 
Y Giridhar Appaji Nag | http://www.appaji.net/


signature.asc
Description: Digital signature


Bug#464384: elinks_0.12~20080127-1(experimental/amd64/xenophanes): -Werror, warning: cast from pointer to integer of different size

2008-02-09 Thread Kalle Olavi Niemitalo
Kalle Olavi Niemitalo [EMAIL PROTECTED] writes:

 There has been a similar warning in src/network/ssl/socket.c, at
 the gnutls_transport_set_ptr call.  That could also be silenced
 with an extra cast, but this would in principle also require
 changing the code that converts the pointer back to an integer,
 and I can't find where that happens, so I'm not changing it now.
 Perhaps there is no such code and the call could just be removed.

The opposite cast is in GnuTLS itself.  I have pushed the
alignof patch to elinks-0.12, as well as the following.

Debian bug 464384: fix cast warning in ssl_connect

There are warnings about casts in the Debian amd64 build logs:
http://buildd.debian.org/fetch.cgi?pkg=elinksver=0.11.3-2arch=amd64stamp=1200348983file=log

[CC]   src/intl/gettext/dcigettext.o
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c: In function 
'_nl_find_msg':
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c:745: warning: cast 
from pointer to integer of different size
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c:746: warning: cast 
from pointer to integer of different size
...
[CC]   src/network/ssl/socket.o
/build/buildd/elinks-0.11.3/src/network/ssl/socket.c: In function 'ssl_connect':
/build/buildd/elinks-0.11.3/src/network/ssl/socket.c:219: warning: cast to 
pointer from integer of different size

The warnings in _nl_find_msg were caused by alignof, which I already
fixed.  This commit ought to fix the gnutls_transport_set_ptr call in
ssl_connect.  This warning did not yet happen in bug 464384 because
the others broke the build before it got that far.

---
commit 6555359f8e56b6e08bd1a8f40fd363506a0e3ff5
tree 39257ecb47bd8a12e6bcf1eaa2c7ecf563cd6ef4
parent d529a1f24da6f85ac2ce67f4f4c1f7084485f538
author Kalle Olavi Niemitalo [EMAIL PROTECTED] Sat, 09 Feb 2008 15:07:04 +0200
committer Kalle Olavi Niemitalo [EMAIL PROTECTED] Sat, 09 Feb 2008 15:19:20 
+0200

 NEWS |2 +-
 src/network/ssl/socket.c |9 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index c8cbfd3..6ff7805 100644
--- a/NEWS
+++ b/NEWS
@@ -129,7 +129,7 @@ Miscellaneous:
 
 Build system and compile-time errors (ignore if you don't build ELinks):
 
-* serious Debian bug 464384: fix cast warning in alignof
+* serious Debian bug 464384: fix cast warnings in alignof and ssl_connect
 * bug 725: fix version checking for Ruby in 'configure'
 * enhancement: if make -k was used and a sub-Make fails, build the
   rest before propagating
diff --git a/src/network/ssl/socket.c b/src/network/ssl/socket.c
index 19b8941..eabd8a3 100644
--- a/src/network/ssl/socket.c
+++ b/src/network/ssl/socket.c
@@ -154,8 +154,15 @@ ssl_connect(struct socket *socket)
}
 
 #elif defined(CONFIG_GNUTLS)
+   /* GnuTLS uses function pointers for network I/O.  The default
+* functions take a file descriptor, but it must be passed in
+* as a pointer.  GnuTLS uses the GNUTLS_INT_TO_POINTER and
+* GNUTLS_POINTER_TO_INT macros for these conversions, but
+* those are unfortunately not in any public header.  So
+* ELinks must just cast the pointer the best it can and hope
+* that the conversions match.  */
gnutls_transport_set_ptr(*((ssl_t *) socket-ssl),
-(gnutls_transport_ptr) socket-fd);
+(gnutls_transport_ptr) (longptr_T) socket-fd);
 
/* TODO: Some certificates fuss. --pasky */
 #endif


pgpvLtGvxVvQM.pgp
Description: PGP signature


Bug#464384: elinks_0.12~20080127-1(experimental/amd64/xenophanes): -Werror, warning: cast from pointer to integer of different size

2008-02-09 Thread Y Giridhar Appaji Nag
On 08/02/09 00:39 +0200, Kalle Olavi Niemitalo said ...
 I see amd64 has given these warnings already in ELinks 0.11.3,
 but there they didn't break the build, because configure was not
 run with --enable-debug and so it did not add -Werror to $CFLAGS.

Enabled debugging because this package is for experimental and
features.conf suggested it.

I added a patch to modify bittorrent_peer_request to change the id from
char to enum bittorrent_message_id.  We FTBFS on powerpc[1] and s390[2]
otherwise.

[1] 
http://experimental.debian.net/fetch.php?pkg=elinksver=0.12%7E20080127-1arch=powerpcstamp=1202132370file=logas=raw
[2] 
http://experimental.debian.net/fetch.php?pkg=elinksver=0.12%7E20080127-1arch=s390stamp=1202495801file=logas=raw

However, I don't have a non-x86 box to test any of these.  I suspect
FTBFSs may be a frequent occurance with 0.12 because of -Werror (And I
suppose -Werror for the unreleased versions of ELinks is present with
--enable-debug for a reason).

 Please try the appended patch.
 
 There has been a similar warning in src/network/ssl/socket.c, at
 the gnutls_transport_set_ptr call.  That could also be silenced

I picked both the patches but didn't request an upload yet.  I will try
and find someone who can do these builds and then request for an upload.

Thank you.

Giridhar

-- 
Y Giridhar Appaji Nag | http://www.appaji.net/


signature.asc
Description: Digital signature


Bug#464384: elinks_0.12~20080127-1(experimental/amd64/xenophanes): -Werror, warning: cast from pointer to integer of different size

2008-02-09 Thread Y Giridhar Appaji Nag
On 08/02/10 09:38 +0530, Y Giridhar Appaji Nag said ...
 I added a patch to modify bittorrent_peer_request to change the id from
 char to enum bittorrent_message_id.  We FTBFS on powerpc[1] and s390[2]
 otherwise.

I submitted the patch at http://bugzilla.elinks.cz/show_bug.cgi?id=1002

There are further warnings down the line that cause build failures (this
is for AMD64).

make[4]: Entering directory 
`/tmp/buildd/elinks-0.12~20080127/build-main/src/protocol/smb'
  [CC]   src/protocol/smb/smb2.o
cc1: warnings being treated as errors
/tmp/buildd/elinks-0.12~20080127/src/protocol/smb/smb2.c: In function 'do_smb':
/tmp/buildd/elinks-0.12~20080127/src/protocol/smb/smb2.c:352: warning: format 
'%lld' expects type 'long long int', but argument 3 has type '__off_t'
make[4]: *** [smb2.o] Error 1

Giridhar

-- 
Y Giridhar Appaji Nag | http://www.appaji.net/


signature.asc
Description: Digital signature


Bug#464384: elinks_0.12~20080127-1(experimental/amd64/xenophanes): -Werror, warning: cast from pointer to integer of different size

2008-02-08 Thread Kalle Olavi Niemitalo
Marc 'HE' Brockschmidt [EMAIL PROTECTED] quotes:

 | cc1: warnings being treated as errors
 | /build/buildd/elinks-0.12~20080127/src/intl/gettext/dcigettext.c: In 
 function '_nl_find_msg':
 | /build/buildd/elinks-0.12~20080127/src/intl/gettext/dcigettext.c:745: 
 warning: cast from pointer to integer of different size
 | /build/buildd/elinks-0.12~20080127/src/intl/gettext/dcigettext.c:746: 
 warning: cast from pointer to integer of different size

I see amd64 has given these warnings already in ELinks 0.11.3,
but there they didn't break the build, because configure was not
run with --enable-debug and so it did not add -Werror to $CFLAGS.
Please try the appended patch.

There has been a similar warning in src/network/ssl/socket.c, at
the gnutls_transport_set_ptr call.  That could also be silenced
with an extra cast, but this would in principle also require
changing the code that converts the pointer back to an integer,
and I can't find where that happens, so I'm not changing it now.
Perhaps there is no such code and the call could just be removed.

Debian bug 464384: fix cast warning in alignof

---
commit 3b93dcc4726d4363215233a780df34772d76ee09
tree 3b3b3712e96c7115d44f180758b71ee95aa43b59
parent a2c7af990b11e1772b9f3e26c372213aa0fb8b03
author Kalle Olavi Niemitalo [EMAIL PROTECTED] Sat, 09 Feb 2008 00:24:45 +0200
committer Kalle Olavi Niemitalo [EMAIL PROTECTED] Sat, 09 Feb 2008 00:24:45 
+0200

 NEWS|1 +
 src/osdep/generic.h |2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index 06215f0..ac4c337 100644
--- a/NEWS
+++ b/NEWS
@@ -131,6 +131,7 @@ Miscellaneous:
 
 Build system and compile-time errors (ignore if you don't build ELinks):
 
+* serious Debian bug 464384: fix cast warning in alignof
 * bug 725: fix version checking for Ruby in 'configure'
 * enhancement: if make -k was used and a sub-Make fails, build the
   rest before propagating
diff --git a/src/osdep/generic.h b/src/osdep/generic.h
index 9223cd5..357b602 100644
--- a/src/osdep/generic.h
+++ b/src/osdep/generic.h
@@ -102,7 +102,7 @@ safe_write(int fd, const void *buf, size_t count) {
 
 /* Alignment of types.  */
 #define alignof(TYPE) \
-((int) ((struct { unsigned char dummy1; TYPE dummy2; } *) 0)-dummy2)
+offsetof(struct { unsigned char dummy1; TYPE dummy2; }, dummy2)
 
 /* Using this macro to copy structs is both faster and safer than
  * memcpy(destination, source, sizeof(source)). Please, use this macro instead


pgpofbjN5hgWE.pgp
Description: PGP signature


Bug#464384: elinks_0.12~20080127-1(experimental/amd64/xenophanes): -Werror, warning: cast from pointer to integer of different size

2008-02-06 Thread Marc 'HE' Brockschmidt
Package: elinks
Version: 0.12~20080127-1
Severity: serious
Tags: experimental

Heya,

Building elinks failed on my amd64 buildd:

| Automatic build of elinks_0.12~20080127-1 on xenophanes by sbuild/amd64 
98-farm
| Build started at 20080204-1332
| **

[...]

| cc1: warnings being treated as errors
| /build/buildd/elinks-0.12~20080127/src/intl/gettext/dcigettext.c: In function 
'_nl_find_msg':
| /build/buildd/elinks-0.12~20080127/src/intl/gettext/dcigettext.c:745: 
warning: cast from pointer to integer of different size
| /build/buildd/elinks-0.12~20080127/src/intl/gettext/dcigettext.c:746: 
warning: cast from pointer to integer of different size
| make[4]: *** [dcigettext.o] Error 1
| make[4]: Leaving directory 
`/build/buildd/elinks-0.12~20080127/build-main/src/intl/gettext'
| make[3]: *** [all-recursive] Error 1
| make[3]: Leaving directory 
`/build/buildd/elinks-0.12~20080127/build-main/src/intl'
| make[2]: *** [all-recursive] Error 1
| make[2]: Leaving directory `/build/buildd/elinks-0.12~20080127/build-main/src'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory `/build/buildd/elinks-0.12~20080127/build-main'
| make: *** [build-arch-stamp] Error 2
| dpkg-buildpackage: failure: debian/rules build gave error exit status 2
| **
| Build finished at 20080204-1336
| FAILED [dpkg-buildpackage died]
| Build needed 00:01:50, 36520k disk space

A complete build log can be found at
http://experimental.debian.net/build.php?arch=amd64pkg=elinksver=0.12~20080127-1

Marc
-- 
Fachbegriffe der Informatik - Einfach erklärt
219: fortschrittlich
   Setzen immer den neuesten Schwachsinn ein. (Gerhard Schromm)



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