Bugs item #2535084, was opened at 2009-01-25 01:59 Message generated for change (Comment added) made by paulmcq You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=616200&aid=2535084&group_id=96864
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Den Ivanov (dsdiv) Assigned to: Paul McQuesten (paulmcq) Summary: re2c 0.13.5 not compile with Sun C Initial Comment: re2c 0.13.5 not compile with Sun C compiler at Solaris 10 x64: CC -DHAVE_CONFIG_H -I. -g -c -o parser.o parser.cc "parser.y", line 98: Warning (Anachronism): Assigning std::pair<unsigned, re2c::RuleOp*> to std::pair<int, re2c::RegExp*>. "parser.y", line 98: Error: Cannot cast from std::pair<unsigned, re2c::RuleOp*> to std::pair<int, re2c::RegExp*>. 1 Error(s) and 1 Warning(s) detected. Compiler version: "Sun C 5.8 Patch 121016-07 2007/10/03" ---------------------------------------------------------------------- >Comment By: Paul McQuesten (paulmcq) Date: 2011-09-25 19:49 Message: Code in revision 900. ---------------------------------------------------------------------- Comment By: Paul McQuesten (paulmcq) Date: 2011-09-25 19:48 Message: Sun compiler rightly objected to assigning a size_t to an int. With default x86_64 memory model that is storing a uint64_t into an int32_t. OTHO, 2 billion spec entries is quite sufficient for this decade. Structure changed to uint32_t, and code changed to do explicit truncation. Could someone with a Solaris compiler please test this? ---------------------------------------------------------------------- Comment By: Paul McQuesten (paulmcq) Date: 2011-05-24 00:57 Message: Note that the patch proposed by davidmarker on 2010-10-04 is dangerous: it assumes that an 'int' is as big as a 'size_t', which is not true for the default x86_64 memory models on Linux where int is 4 bytes but size_t is 8. ---------------------------------------------------------------------- Comment By: Paul McQuesten (paulmcq) Date: 2011-01-09 21:52 Message: I do not have your compilers, so cannot really check, but I think the proposed patch just hides a symptom. I think the actual fix should be on line 495 of re.h. Change first member of NRegExp to size_t: from: typedef std::pair<int, RegExp*> NRegExp; to: typedef std::pair<size_t, RegExp*> NRegExp; The second member is okay as is, because RuleOp is a derived class of RegExp. ---------------------------------------------------------------------- Comment By: David Marker (davidmarker) Date: 2010-10-04 13:35 Message: Hit same issue, resolved it with this patch (but haven't tested yet, just got it to build): --- parser.cc-orig Mon Oct 4 14:22:39 2010 +++ parser.cc Mon Oct 4 14:21:17 2010 @@ -198,7 +198,8 @@ else { size_t nIndex = specMap.size() + 1; // 0 is reserved for "0"-spec - specMap[*it] = std::make_pair(nIndex, rule); + //specMap[*it] = std::make_pair(nIndex, rule); + specMap[*it] = std::make_pair((int)nIndex, static_cast<RegExp*>(rule)); } } ---------------------------------------------------------------------- Comment By: Thomas Wagner (tom68) Date: 2009-02-13 05:41 Message: it is the same with sparc and "Sun Ceres C 5.10 SunOS_sparc 2008/10/22" (SunStudioExpress): pkgbuild: /opt/SUNWspro/bin/CC -DHAVE_CONFIG_H -I. -g -c -o parser.o parser.cc pkgbuild: "parser.y", line 98: Warning (Anachronism): Assigning std::pair<unsigned, re2c::RuleOp*> to std::pair<int, re2c::RegExp*>. pkgbuild: "parser.y", line 98: Error: Cannot cast from std::pair<unsigned, re2c::RuleOp*> to std::pair<int, re2c::RegExp*>. pkgbuild: 1 Error(s) and 1 Warning(s) detected. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=616200&aid=2535084&group_id=96864 ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ Re2c-general mailing list Re2c-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/re2c-general