This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/1722: unsigned int confused with pointer



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]