Greetings, First of all please note that I was using the SunStudio-12 compiler and not GCC for this. I'm sorry if I was not clear on that point. If I use GCC however I do not get any complaint about the operator overloading. It ends up like this. g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/usr/local/squid/etc/squid.conf\" -I. -I. -I../include -I. -I. -I../include -I../include -I../lib/libTrie/include -I/usr/include/libxml2 -I/usr/local/include -Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments -D_REENTRANT -pthreads -DSOLARIS2=11 -g -O2 -MT IPInterception.lo -MD -MP -MF .deps/IPInterception.Tpo -c IPInterception.cc -o IPInterception.o In file included from /usr/include/inet/ip_stack.h:37, from /usr/include/inet/ip.h:50, from /usr/include/netinet/ip_compat.h:189, from IPInterception.cc:59: /usr/include/sys/md5.h:62: error: conflicting declaration 'typedef struct MD5_CTX MD5_CTX' ../include/md5.h:59: error: 'MD5_CTX' has a previous declaration as `typedef struct MD5Context MD5_CTX' /usr/include/sys/md5.h:62: error: declaration of `typedef struct MD5_CTX MD5_CTX' ../include/md5.h:59: error: conflicts with previous declaration `typedef struct MD5Context MD5_CTX' /usr/include/sys/md5.h:62: error: declaration of `typedef struct MD5_CTX MD5_CTX' ../include/md5.h:59: error: conflicts with previous declaration `typedef struct MD5Context MD5_CTX' /usr/include/sys/md5.h:62: error: declaration of `typedef struct MD5_CTX MD5_CTX' ../include/md5.h:59: error: conflicts with previous declaration `typedef struct MD5Context MD5_CTX' /usr/include/sys/md5.h:66: error: declaration of C function `void MD5Final(void*, MD5_CTX*)' conflicts with ../include/md5.h:63: error: previous declaration `void MD5Final(uint8_t*, MD5Context*)' here gmake[1]: *** [IPInterception.lo] Error 1 gmake[1]: Leaving directory `/export/home/randy/Download/squid-3.0.RC1/src' gmake: *** [all-recursive] Error 1 With Sun C however after commenting out the line you suggested, it ends up like this.... CC -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/usr/local/squid/etc/squid.conf\" -I. -I. -I../include -I. -I. -I../include -I../include -I../lib/libTrie/include -I/usr/include/libxml2 -I/usr/local/include -fhuge-objects -D_REENTRANT -mt -DSOLARIS2=11 -fast -m64 -mt -xtarget=opteron -xarch=sse3a -xchip=opteron -c comm.cc -o comm.o CC: Warning: Option -fhuge-objects passed to ld, if ld is invoked, ignored otherwise "cbdata.h", line 48: Warning: Identifier expected instead of "}". "cbdata.h", line 134: Error: "}" expected instead of ";". "cbdata.h", line 135: Error: A declaration was expected instead of "}". "MemBuf.h", line 125: Error: "}" expected instead of ";". "MemBuf.h", line 53: Error: buf is not defined. "MemBuf.h", line 55: Error: buf is not defined. "MemBuf.h", line 57: Error: size is not defined. "MemBuf.h", line 59: Error: size is not defined. "MemBuf.h", line 62: Error: buf is not defined. "MemBuf.h", line 62: Error: size is not defined. "MemBuf.h", line 65: Error: size is not defined. "MemBuf.h", line 65: Error: capacity is not defined. "MemBuf.h", line 80: Error: stolen is not defined. "MemBuf.h", line 127: Error: A declaration was expected instead of "public". "MemBuf.h", line 139: Error: "," expected instead of ":". "MemBuf.h", line 147: Error: A declaration was expected instead of "}". "MemBuf.cci", line 36: Error:<no tag> cannot be initialized in a constructor. "MemBuf.cci", line 36: Error:<no tag> cannot be initialized in a constructor. "MemBuf.cci", line 36: Error:<no tag> cannot be initialized in a constructor. "MemBuf.cci", line 36: Error:<no tag> cannot be initialized in a constructor. "MemBuf.cci", line 36: Error:<no tag> cannot be initialized in a constructor. "AsyncEngine.h", line 61: Warning: Identifier expected instead of "}". "comm.h", line 24: Warning: Identifier expected instead of "}". "pconn.h", line 41: Error: "}" expected instead of ";". "pconn.h", line 42: Error: A declaration was expected instead of "}". "comm.cc", line 330: Warning: Identifier expected instead of "}". "comm.cc", line 1945: Error: buf is not a member of MemBuf. "comm.cc", line 1945: Error: size is not a member of MemBuf. "comm.cc", line 2106: Warning: fd hides fdc_t::fd. 24 Error(s) and 5 Warning(s) detected. *** Error code 1 make: Fatal error: Command failed for target `comm.lo' Current working directory /export/home/randy/Download/squid-3.0.RC1/src *** Error code 1 The following command caused the error: failcom='exit 1'; \ for f in x $MAKEFLAGS; do \ case $f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo all-recursive | sed s/-recursive//`; \ list='lib snmplib scripts src icons errors doc helpers test-suite tools'; for subdir in $list; do \ echo "Making $target in $subdir"; \ if test "$subdir" = "."; then \ dot_seen=yes; \ local_target="$target-am"; \ else \ local_target="$target"; \ fi; \ (cd $subdir && make $local_target) \ || eval $failcom; \ done; \ if test "$dot_seen" = "no"; then \ make "$target-am" || exit 1; \ fi; test -z "$fail" make: Fatal error: Command failed for target `all-recursive' -- Randall D. DuCharme (Radio AD5GB) Powered by OpenSolaris! http://www.opensolaris.org --- On Wed 11/07, Alex Rousskov < rousskov@xxxxxxxxxxxxxxxxxxxxxxx > wrote: From: Alex Rousskov [mailto: rousskov@xxxxxxxxxxxxxxxxxxxxxxx] To: radio-ad5gb@xxxxxxxxxx Cc: squid-users@xxxxxxxxxxxxxxx Date: Wed, 07 Nov 2007 13:17:22 -0700 Subject: Re: Solaris/OpenSSL/MD5 Issues On Wed, 2007-11-07 at 23:18 +1300, Amos Jeffries wrote: > > Further, I've tried to build 3.0RC1 with SunStudio12 but it> complains about operator overloading when building Squid's 3.0 RC1> like so:> > > > CC: Warning: Option -fhuge-objects passed to ld, if ld is invoked, ignored otherwise> > "HttpRequestMethod.h", line 138: Error: Overloading ambiguity between > "operator!=(const HttpRequestMethod&, const _method_t&)" and "operator!=(int, int)".> > 1 Error(s) detected.> > *** Error code 1> > make: Fatal error: Command failed for target `cf_gen.o'> > Current working directory /export/home/randy/Download/squid-3.0.RC1/src> > This second looks like a compiler issue.> Somehow its not registering types properly in its symbol tables. It's > confusing ptr with int, and even appears to be screwing the const > correctness over (the error is for constptr-to-data, where the squid > code contains ptr-to-constdata. Two very different types in C++).This might be a Squid bug. I am not an expert on this, but I am notsurprised that GCC is confused by the halfway migration from method_tenum to HttpRequestMethod class.There are no pointers involved here. The global "!=" operator on line138 provides comparison between a [reference to] HttpRequestMethod and amethod_t. There is also a constructor that can create anHttpRequestMethod from a method_t. Method_t is an enum, so it is treatedlike an int in many contexts.Thus, when we write "5 != 6", GCC may not know whether he is supposed tocreate an HttpRequestMethod from 5 and method_t from 6 to use the customoperator or just go with the built-in operator for integer comparison.Remove the global operator != at line 138 of HttpRequestMethod.h andSquid may compile. It does in my test, but I did not have the aboveproblem to start with so YMMV. Please keep me posted as I would like tocommit this fix if it works for you.Thank you,Alex. _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web!