-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'hb-set.hh' build errors with MSVC #1374
Comments
John. If you want a fix, I need all different instances of the error. |
Hi Behdad - I haven't loaded your new commit yet (if it only deals with warnings) but here are the errors I see from just compiling 'hb-aat-layout.cc' (the remaining source files seem to produce the same errors):- (line 378 - hb-set.hh) - memcpy (pages, other->pages, count * sizeof (pages[0])); (line 379 - hb-set.hh) - memcpy (page_map, other->page_map, count * sizeof (page_map[0])); (line 663 - hb-set.hh) - return page_map[i].major * page_t::PAGE_BITS + page_at (i).get_max (); (line 681 - hb-set.hh) - (page_map.len - 1 - i) * sizeof (page_map[0])) (line 1520 - hb-ot-layout-common.hh) - DEFINE_SIZE_ARRAY (4, axesZ); (line 1579 - hb-ot-layout-common.hh) - DEFINE_SIZE_ARRAY2 (6, regionIndices, bytesX); (line 1895- hb-ot-layout-common.hh) - DEFINE_SIZE_ARRAY (6, deltaValueZ); (line 1350 - hb-ot-layout-gsubgpos.hh) - return_trace (inputCount.sanitize (c) && (line 1369 - hb-ot-layout-gsubgpos.hh) - DEFINE_SIZE_ARRAY (4, inputZ); (line 1675 - hb-ot-layout-gsubgpos.hh) - if (!(this+coverageZ[0]).intersects (glyphs)) (line 1690 - hb-ot-layout-gsubgpos.hh) - if (!(this+coverageZ[0]).intersects (c->glyphs)) (line 1707 - hb-ot-layout-gsubgpos.hh) - (this+coverageZ[0]).add_coverage (c->input) (line 1734 - hb-ot-layout-gsubgpos.hh) - { return this+coverageZ[0]; } (line 1739 - hb-ot-layout-gsubgpos.hh) - unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint); (line 1782 - hb-ot-layout-gsubgpos.hh) - DEFINE_SIZE_ARRAY (6, coverageZ); (line 399 - hb-ot-layout-gpos-table.hh) - DEFINE_SIZE_ARRAY (2, matrixZ); (line 165 - hb-aat-layout-trak-table.hh) - DEFINE_SIZE_ARRAY (8, trackTable) (line 165 - hb-aat-layout-trak-table.hh) - DEFINE_SIZE_ARRAY (8, trackTable) |
Hi Behdad - I just updated from git and your changes do seem to have fixed the errors (in 'hb-set.hh') at lines 378 and 379. So you probably need to do something similar in the other cases. Thanks for helping with this. |
Okay, give it another try. |
Okay, there seem to be problems now with the use of 'static_size' in various places. The most common ones seem to be in the macro DEFINE_SIZE_ARRAY. Wherever it gets used I see an error like this:-
I'm seeing similar issues with the use of 'coverageZ' which gives similar errors when it exposes members like 'sanitize' . 'get_coverage' / 'add_coverage' etc. Maybe I should go back to the previous version and just accept that Harfbuzz won't build for me any more..? |
Okay, this is becoming bizarre. What was the last version you could compile?
Please paste error message. |
The last time Harfbuzz built successfully was only about 3 weeks ago (Ebrahim's commit #03e144135b from 18th Oct). To be honest, these feel like multiple instances of a small number of problems. This isn't a comprehensive list but as some examples, I'm seeing errors like these, relating to DEFINE_SIZE_ARRAY:- (line 1520 - hb-ot-layout-common.hh) - DEFINE_SIZE_ARRAY (4, axesZ); (line 1579 - hb-ot-layout-common.hh) - DEFINE_SIZE_ARRAY2 (6, regionIndices, bytesX); (line 1369 - hb-ot-layout-gsubgpos.hh) - DEFINE_SIZE_ARRAY (4, inputZ); *** and several more like the above - plus errors like these (relating to 'coverageZ') *** (line 1675 - hb-ot-layout-gsubgpos.hh) - if (!(this+coverageZ[0]).intersects (glyphs)) (line 1707 - hb-ot-layout-gsubgpos.hh) - (this+coverageZ[0]).add_coverage (c->input); (line 1739 - hb-ot-layout-gsubgpos.hh) - unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint); (line 1765 - hb-ot-layout-gsubgpos.hh) - if (!coverageZ[i].sanitize (c, this)) return_trace (false); |
Such bizarre errors. I'm out of ideas. Either play with DEFINE_SIZE_ARRAY, diff it with the last good version, change, see what works (does removing the paranthesis around |
Yes it does seem strange. From a superficial glance, the lines which are failing don't seem to have changed between the working version and the non-working version. I'll try git bisect and see if that reveals anything. |
Okay, the problematic commit seems to be commit #955aa56b11 from 26th Oct 2018 and it's entitled "[vector] Make it act more like pointer". I can't say if that's responsible for all the problems I'm seeing but that's definitely where they began. Can I ask an obvious question..? Does Harfbuzz need C++11? (because obviously, that wouldn't be available as far back as VS2008). |
And this is only a hunch - but I've a feeling the remaining problems originate in the changes made to 'hb-open-type.hh' and 'hb-dsalgs.hh' between 31st Oct and 5th Nov (I'm referring to the changes that have now affected 'DEFINE_SIZE_ARRAY'). Those ones look quite similar to the changes I just reported in 'hb-vector.hh'. |
Please reopen if you can debug and send a patch. Otherwise, faulty compiler none of the developers have access to. |
Follow up on b4c6113 Fixes harfbuzz#1374
Hey @johne53, we made some progress here, have a look at master. |
Thanks for persevering guys. Things have definitely improved but essentially, I'm seeing the same kind of problems that I documented on Nov 10th.. Taking 'hb-set.hh' as an example, the C2666 errors I reported (at lines 378, 379 and 663) are gone now - but the error at line 681 is still present. And for 'hb-ot-layout-common.hh', the DEFINE_SIZE_ARRAY errors are still present - although the error for DEFINE_SIZE_ARRAY2 seems to have gone now. Essentially, Behdad is right (this is definitely a compiler issue). I can build Harfbuzz okay with VS2015. It'd be nice to get the errors fixed (as I still need to use VS2008 for this particular project). But if that involves too much work, I can just use an older version of Harfbuzz when building this project |
Interesting that 32bit version of llvm-gcc-4.2 reproduces the same issues apparently https://circleci.com/gh/harfbuzz/harfbuzz/60776 so Behdad now has access to the compiler :) |
Now our weirdest bot compiles harfbuzz, I guess VS2008 should also, please test it :) |
The built-in operator takes signed int. So, match it, such that the built-in is never a better or equally-good match to our operator. Fixes "ambiguous overload" errors from gcc 4.2 and VS 2008. See #1374
The built-in operator takes signed int. So, match it, such that the built-in is never a better or equally-good match to our operator. Fixes "ambiguous overload" errors from gcc 4.2 and VS 2008. See #1374
Thanks again guys. The good news is that the error I referred to in 'hb-set.hh' (line 681) is fixed now. And likewise, the errors in 'hb-ot-layout-common.hh' (i.e. DEFINE_SIZE_ARRAY) are also now fixed. The bad news is that this has just exposed similar errors elsewhere - e.g. 'hb-set.hh' now shows the same kind of error at lines 241, 395, 548, 550, 552, 559, 562, 579, 581 and 583 (which I wasn't seeing before). That's to be expected though (it just means that the compilation can get a bit further now). FWIW I also see similar errors in:- One thing that complicates everything is the sheer number of updates to Harfbuzz (often hundreds of commits per day). If you need to solve this issue specifically, it'd make sense to create a temporary branch (just for fixing this problem) and eventually merge it into master. I get the feeling this'll turn into a long job though... :-( |
John, I don't know how many times I need to say this: I need all error messages, not just a casual line number mention. |
I'm still interested to see, since I've been kicking a similarly old compiler... :) |
But yeah, the new ones are harder to fix. |
I'm seeing lots of errors when trying to build harfbuzz (from git master) with MSVC. They relate to some recent changes in 'src/hb-set.hh' (approx line 370) where 'sizeof (pages.arrayZ()[0])' got changed to 'sizeof (pages[0])'.
A similar error occurs on the following line - where 'sizeof (page_map.arrayZ()[0])' got changed to 'sizeof (page_map[0])'. This is the general form for each error:-
harfbuzz\src\hb-set.hh(378) : error C2666: 'hb_vector_t<Type,StaticSize>::operator []' : 4 overloads have similar conversions
: could be 'const hb_set_t::page_t &hb_vector_t<Type,StaticSize>::operator [](unsigned int) const'
: or 'hb_set_t::page_t &hb_vector_t<Type,StaticSize>::operator [](unsigned int)'
: or 'built-in C++ operator[(T *, int)'
: or 'built-in C++ operator[(const T *, int)'
I'm also seeing "multiple overload" errors in other places - e.g. for DEFINE_SIZE_ARRAY and its variants. As it happens, this project needs to get built with MSVC2008 - although these particular errors look like they'd occur, even with the more recent versions.
The text was updated successfully, but these errors were encountered: