Re: MSVC C++ problems

From: Gerard Eviston <geviston@dont-contact.us>
Date: Mon, 14 Jul 2003 20:44:49 +1000

On Mon, 14 Jul 2003 08:41, Robert Collins wrote:
> Well, try this out, and we can generalise if it works:
> ===
> static const long Cookie = (long)0xDEADBEEF;
> static long MakeOffset();
> static const long Offset;
> };
> ===
> to
> ===
> static const long Cookie;
> static long MakeOffset();
> static const long Offset;
> };
>
> const long cbdata::Cookie((long)0xDEADBEEF);
>
> ===

xlC and I also had trouble with this one, but got an undefined symbol instead
of anything that resembled Guido's error. Some info on out-of-class
definitions of static const members is in 9.4.2.4 of the C++ std. But back in
the real world, your patch above fixes an undefined symbol for cbdata::Cookie
and the only other out-of-class definition I needed was for
AcceptFD::MAX_ACCEPT_PER_LOOP.

---
/home/gerard/squid/aix-fixes/{arch}/++pristine-trees/unlocked/squid/squid--aix-fixes/squid--aix-fixes--3.0/gerard@eviston.net--squid/squid--aix-fixes--3.0--patch-9/./src/comm.cc
2003-06-11 22:42:29.000000000 +1000
+++ /home/gerard/squid/aix-fixes/./src/comm.cc 2003-06-15 16:51:40.000000000
+1000
@@ -109,11 +109,13 @@
     void finished(bool);

 private:
- static size_t const MAX_ACCEPT_PER_LOOP = 10;
+ static size_t const MAX_ACCEPT_PER_LOOP;
     size_t count;
     bool finished_;
 };

+size_t const AcceptFD::MAX_ACCEPT_PER_LOOP(10);
+
 class CommWrite
 {
Received on Mon Jul 14 2003 - 04:52:29 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:20:16 MST