This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [Fixed-point] Warning/Error for fixed point constants


Hello Sir,

1. dk is an invalid suffix.
2. Yes, there is an internal conversion.  Can you read the spec
and let me know if we need warnings when internal conversions among
fixed-point types happen?  Thanks!

  A  similar topic: I plan to add warnings when overflow or underflow occurs
during
conversions to regular fixed-point types.  For saturating fixed-point types,
we may ignore
overflow or underflow.

Regards,
Chao-ying


----- Original Message ----- 
From: "Mohamed Shafi" <shafitvm@gmail.com>
To: "Fu, Chao-Ying" <fu@mips.com>
Cc: <gcc-patches@gcc.gnu.org>
Sent: Thursday, January 11, 2007 5:54 AM
Subject: [SPAM?] [Fixed-point] Warning/Error for fixed point constants


> Hello sir,
>
> 1. For the following code the error that is obtained is
>
>      _Accum = 0.3dk;
>
> error: invalid suffix "dk" on floating constant
>
> Should the error message be informing about fixed point constant  ?
>
> 2. For the following code
>
>    short _Fract = 3.5ulk;
>
> I am not getting a warning or an error message.
> So some kind of internal conversion is taking place.Is it getting
> converted to short fract type ?
> Shouldn't there be a warning to indicate that the value is converted
> to _fract type?
> or should it be error?
>
> With no error or warning it doesn't matter what suffix one gives to
> fixed point data type as long as its something specified by the
> standard. Is this the right way?
>
>
> Regards,
> Shafi
>


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