help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

casting from unsigned short int to unsigned int (on gcc 3.4.4, compiles


From: whizz_kid
Subject: casting from unsigned short int to unsigned int (on gcc 3.4.4, compiles fine with 2.95.1)
Date: 7 Mar 2006 22:07:19 -0800
User-agent: G2/0.2

Hi all,
I am facing some strange problem here with gcc 3.4.4
(The code compiles fine with gcc 2.95.1)
Specifically,
If I have the following function (part of class Class1)
void Class1::function1( ostrstream & data, Class2::Info1 & a,
info_var_1 & m, TDF_U32 & ret ) { .... }

here:
TDF_U32 is  a typedef for unsigned int

then call this from some other function as:
function1( msg_1, obj.info1, obj.info2, (TDF_U32) obj.retsend );

here:
'obj.retsend' is a unsigned short int and hence the cast is required.

This code gives the follwowing error when compiling with gcc 3.4.4

error: no matching function for call to Class1::function1( ostrstream
&, Class2::Info1 &, info_var_1 &, TDF_U32 )

The next line says:
note: candidates are: void Class1::function1( ostrstream &,
Class2::Info1 &, info_var_1 &, TDF_U32 &)

It seems that there is no effect of the cast that was done to convert
'unsigned short int' to 'unsigned int'

Can anyone please tell me whats happenning here....??

Thanking you in anticiaption...
With regards,
Raj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]