- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get an internal error 0_1989 when I try to compile the opensource FreeImage library with /Qparallel set on a windows x64 platform
http://downloads.sourceforge.net/freeimage/FreeImage3110.zip
The error occurs in file WuQuantizer.cpp due to the loop starting on line 130. The loop as it stands in the library has a bug, but the internal error persists even with the bug fixed as follows
for(i = 0; i < 35937; i++) {
if( vwt > max ) max = vwt;
}
The error disappears by adding a dummy (int)exp(0.0) to the constant 35937 above. The code compiles on win32
Is there an explanation for this and a better workaround?
Thank you,
zestony
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The error disappears by adding a dummy (int)exp(0.0) to the constant 35937 above. The code compiles on win32
Is there an explanation for this and a better workaround?
Utilities.h(131): remark #2259: non-pointer conversion from "int" to "unsigned char" may lose significant bits
return byte & 0xF0;
^
Utilities.h(136): remark #2259: non-pointer conversion from "int" to "unsigned char" may lose significant bits
return byte & 0x0F;
^
Utilities.h(191): remark #981: operands are evaluated in unspecified order
memcpy(result + strlen(filename) + 1, extension, strlen(extension) + 1);
^
Utilities.h(191): remark #981: operands are evaluated in unspecified order
memcpy(result + strlen(filename) + 1, extension, strlen(extension) + 1);
^
Utilities.h(223): remark #1418: external function definition with no prior declaration
template
^
Utilities.h(228): remark #1418: external function definition with no prior declaration
template
^
Utilities.h(233): remark #1418: external function definition with no prior declaration
template
^
Utilities.h(245): remark #1418: external function definition with no prior declaration
MAXMIN(const T* L, long n, T& max, T& min) {
^
tony.cpp(178): remark #2259: non-pointer conversion from "int" to "WORD={uint16_t={unsigned short}}" may lose significant bits
ind1 = INDEX(r, g, b); //
^
tony.cpp(189): remark #2259: non-pointer conversion from "int" to "WORD={uint16_t={unsigned short}}" may lose significant bits
ind2 = ind1 - 1089; // [r-1]
_____________________________________
How does your suggested "workaround" address it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
_____________________________________
How does your suggested "workaround" address it?
The exp(0.0) is an expression the compiler cannot evaluate and hence the bounds of the loop are not known and I guess the compiler does not attempt to parallelize the loop. I would expect the compiler to not attempt parallelization even with a constant loop bound since the loop iterations are not independent. Indeed, there was no parallelization in a small program that I wrote that just finds the maximum entry of a fixed size array. There is some other ingredient in the FreeImage program that seems to mislead the compiler. The error disappear if the loop bound is 7499 or less. With 7500 and above -> internal error 0_1989
BTW it is not necessary to compile the whole FreeImage project. The error can be observed by compiling the single file WuQuantizer.cpp
tim18, I did not understand the compiler output snippet that you attached. Could you please explain?
Thanks,
zestony
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page