Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Intel Compiler Error
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
jpsdr
Posted: Oct 15 2011, 10:49 AM


Advanced Member


Group: Members
Posts: 335
Member No.: 20490
Joined: 23-December 06



I've the following problem with last Intel compiler :

>int128.cpp(40): error : no suitable user-defined conversion from "vduint128" to "const vdint128" exists
1> return (q[1]^x.q[1])<0 ? -(const vdint128&)bd : (const vdint128&)bd;

CODE

const vdint128 vdint128::operator*(const vdint128& x) const {
vdint128 X = x.abs();
vdint128 Y = abs();

vduint128 bd(VDUMul64x64To128(X.q[0], Y.q[0]));

bd.q[1] += X.q[0]*Y.q[1] + X.q[1]*Y.q[0];

return (q[1]^x.q[1])<0 ? -(const vdint128&)bd : (const vdint128&)bd;
}
 
     Top
jpsdr
Posted: Oct 17 2011, 07:32 AM


Advanced Member


Group: Members
Posts: 335
Member No.: 20490
Joined: 23-December 06



So, of course, question is : How correct it ?
Strange thing is that until the last version, it compiled without problem... sad.gif
 
     Top
IanB
Posted: Oct 17 2011, 09:10 PM


Avisynth Team Member


Group: Members
Posts: 121
Member No.: 22295
Joined: 23-October 07



The compiler is right but is being overly pedantic. You can probably deceive it with some & and * magic.

(const vdint128&)(*((vdint128*)&bd))

 
     Top
jpsdr
Posted: Oct 19 2011, 07:33 AM


Advanced Member


Group: Members
Posts: 335
Member No.: 20490
Joined: 23-December 06



Thanks, it worked.
 
     Top
phaeron
Posted: Oct 23 2011, 07:31 PM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



I don't understand why the Intel compiler is trying to issue a value cast here. C-style casts are allowed to do a reinterpret_cast and a diagnostic can only be issued if the cast is impossible or ambiguous. There are no conversions between vdint128 and vduint128 that would allow an ambiguous cast situation.
 
    Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
4 replies since Oct 15 2011, 10:49 AM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Filters and Filter Development