[patch] Fix some errors building with clang++ trunk.

From: Pawel Worach <pawel.worach_at_gmail.com>
Date: Thu, 11 Aug 2011 22:14:44 +0200

Hi!
Here is patch for squid3 trunk that fixes a couple of compile errors with clang++ trunk.
The hack in src/ChunkedCodingParser.cc gets rid of a warning that complains about a empty if statement.
There is still an issue on FreeBSD where strtoll ends up undefined, I still have no idea what is going on there.

=== modified file 'acinclude/krb5.m4'
--- acinclude/krb5.m4 2010-12-10 09:59:02 +0000
+++ acinclude/krb5.m4 2011-08-11 18:19:29 +0000
@@ -122,7 +122,8 @@
 #endif
 #endif
 #include <krb5.h>
-main()
+int
+main(void)
 {
     krb5_context context;
     krb5_ccache cc;

=== modified file 'compat/xalloc.cc'
--- compat/xalloc.cc 2011-07-25 22:17:24 +0000
+++ compat/xalloc.cc 2011-08-11 18:43:01 +0000
@@ -119,7 +119,7 @@
     if (p == NULL) {
         if (failure_notify) {
             static char msg[128];
- snprintf(msg, 128, "xmalloc: Unable to allocate %Zu bytes!\n", sz);
+ snprintf(msg, 128, "xmalloc: Unable to allocate %zu bytes!\n", sz);
             failure_notify(msg);
         } else {
             perror("malloc");
@@ -167,7 +167,7 @@
     if (p == NULL) {
         if (failure_notify) {
             static char msg[128];
- snprintf(msg, 128, "xrealloc: Unable to reallocate %Zu bytes!\n", sz);
+ snprintf(msg, 128, "xrealloc: Unable to reallocate %zu bytes!\n", sz);
             failure_notify(msg);
         } else {
             perror("realloc");

=== modified file 'src/ChunkedCodingParser.cc'
--- src/ChunkedCodingParser.cc 2010-10-21 03:18:45 +0000
+++ src/ChunkedCodingParser.cc 2011-07-25 17:21:48 +0000
@@ -159,9 +159,11 @@
     size_t crlfEnd = 0;
 
     if (findCrlf(crlfBeg, crlfEnd)) {
+#if NOTYET
         if (crlfBeg > 0)
 
             ; //theTrailer.append(theIn->content(), crlfEnd);
+#endif
 
         theIn->consume(crlfEnd);
 

=== modified file 'src/dns_internal.cc'
--- src/dns_internal.cc 2011-07-23 08:37:52 +0000
+++ src/dns_internal.cc 2011-07-25 17:22:26 +0000
@@ -676,7 +676,7 @@
     }
 
     if (Config.dns.packet_max > 0)
- storeAppendPrintf(sentry, "DNS jumbo-grams: %Zd Bytes\n", Config.dns.packet_max);
+ storeAppendPrintf(sentry, "DNS jumbo-grams: %zd Bytes\n", Config.dns.packet_max);
     else
         storeAppendPrintf(sentry, "DNS jumbo-grams: not working\n");
 

=== modified file 'tools/purge/conffile.cc'
--- tools/purge/conffile.cc 2010-11-20 11:31:38 +0000
+++ tools/purge/conffile.cc 2011-08-11 19:59:01 +0000
@@ -37,7 +37,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 

=== modified file 'tools/purge/convert.cc'
--- tools/purge/convert.cc 2010-11-21 04:40:05 +0000
+++ tools/purge/convert.cc 2011-08-11 19:59:34 +0000
@@ -43,7 +43,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 

=== modified file 'tools/purge/copyout.cc'
--- tools/purge/copyout.cc 2010-08-21 00:12:42 +0000
+++ tools/purge/copyout.cc 2011-08-11 19:59:45 +0000
@@ -38,7 +38,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 

=== modified file 'tools/purge/purge.cc'
--- tools/purge/purge.cc 2011-07-25 22:31:04 +0000
+++ tools/purge/purge.cc 2011-08-11 19:59:54 +0000
@@ -93,7 +93,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 
@@ -292,7 +292,7 @@
                   (unsigned long)temp.timestamp, (unsigned long)temp.lastref,
                   (unsigned long)temp.expires, (unsigned long)temp.lastmod, temp.flags, temp.refcount );
     } else {
- snprintf( timeb, sizeof(timeb), "%08lx %08lx %08lx %08lx %04x %5hu ", (unsigned long)-1, (unsigned long)-1, (unsigned long)-1, (unsigned long)-1, 0, 0 );
+ snprintf( timeb, sizeof(timeb), "%08lx %08lx %08lx %08lx %04x %5d ", (unsigned long)-1, (unsigned long)-1, (unsigned long)-1, (unsigned long)-1, 0, 0 );
     }
 
     // make sure that there is just one printf()

=== modified file 'tools/purge/signal.cc'
--- tools/purge/signal.cc 2010-08-21 00:12:42 +0000
+++ tools/purge/signal.cc 2011-08-11 19:59:59 +0000
@@ -45,7 +45,7 @@
 //
 //
 
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 

=== modified file 'tools/purge/socket.cc'
--- tools/purge/socket.cc 2010-11-20 11:31:38 +0000
+++ tools/purge/socket.cc 2011-08-11 20:00:06 +0000
@@ -46,7 +46,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 

=== modified file 'tools/purge/squid-tlv.cc'
--- tools/purge/squid-tlv.cc 2010-08-19 03:33:12 +0000
+++ tools/purge/squid-tlv.cc 2011-08-11 20:00:16 +0000
@@ -35,7 +35,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 

-- 
Pawel
Received on Thu Aug 11 2011 - 20:14:58 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 15 2011 - 12:00:03 MDT