This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/1722: unsigned int confused with pointer
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1722: unsigned int confused with pointer
- From: richarda at ixla dot com dot au
- Date: 22 Jan 2001 03:33:27 -0000
- Reply-To: richarda at ixla dot com dot au
>Number: 1722
>Category: c++
>Synopsis: unsigned int confused with pointer
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jan 21 19:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Richard Andrews, Ixla Ltd.
>Release: CVS-2001-01-15
>Organization:
>Environment:
i686-pc-linux-gnu (RH6.2)
>Description:
Construction of unsigned int results in pointer type.
>How-To-Repeat:
compile this
int
main()
{
typedef unsigned int UInt32;
double d1(11.1);
UInt32 whole( UInt32(d1) );
UInt32 whole2 = UInt32(d1);
double remainder( d1 - double(whole) );
remainder = d1 - double(whole2);
return 0;
}
>Fix:
A work-around exits. Use
UInt32 whole = UInt32(d1);
instead of
UInt32 whole( UInt32(d1) );
>Release-Note:
>Audit-Trail:
>Unformatted: