comp.lang.ada
 help / color / mirror / Atom feed
* How to flag implicit conversions?
@ 2013-05-06  1:23 Yannick Duchêne (Hibou57)
  2013-05-06  5:59 ` J-P. Rosen
  0 siblings, 1 reply; 3+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2013-05-06  1:23 UTC (permalink / raw)


Hi once again,

Yesterday I encountered an issue with a thankfully range‑check‑enabled  
compiled application, involving implicit conversion from  
universal_integer. This occurred in an expression as an argument to a  
function, and the range error disappeared when I added a type  
qualification. To avoid any similar future case, I would like to flag this  
kind of implicit conversion (I know it's supposed to be safe, but seems it  
was not safe with me, or else that was a GNAT bug or an error of mine  
elsewhere I missed). I feel to remember I knew a way to make the compiler  
flag implicit conversions. I don't want it with initializations, only  
within expressions. I can't retrieve that in GNAT warning options. Some  
one see what this option is? Or may be that was with AdaControl and not  
GNAT? I really can't remember how I did make it flagged in the paste.


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to flag implicit conversions?
  2013-05-06  1:23 How to flag implicit conversions? Yannick Duchêne (Hibou57)
@ 2013-05-06  5:59 ` J-P. Rosen
  2013-05-06  8:25   ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 3+ messages in thread
From: J-P. Rosen @ 2013-05-06  5:59 UTC (permalink / raw)


Le 06/05/2013 03:23, Yannick Duchêne (Hibou57) a écrit :
> I can't retrieve that in GNAT warning options. Some one see what this
> option is? Or may be that was with AdaControl and not GNAT?
AdaControl has a rule (simplifiable_expressions (conversion)) to check
conversions of literals that are not necessary.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to flag implicit conversions?
  2013-05-06  5:59 ` J-P. Rosen
@ 2013-05-06  8:25   ` Yannick Duchêne (Hibou57)
  0 siblings, 0 replies; 3+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2013-05-06  8:25 UTC (permalink / raw)


Le Mon, 06 May 2013 07:59:42 +0200, J-P. Rosen <rosen@adalog.fr> a écrit:

> Le 06/05/2013 03:23, Yannick Duchêne (Hibou57) a écrit :
>> I can't retrieve that in GNAT warning options. Some one see what this
>> option is? Or may be that was with AdaControl and not GNAT?
> AdaControl has a rule (simplifiable_expressions (conversion)) to check
> conversions of literals that are not necessary.

Yes, I remember this one. But that must not be the option I believe I've  
seen somewhere, as `simplifiable_expressions` is about the opposite here:  
it would flag an universal expression to which is applied an explicit type  
conversion when it do not serves an ambiguity resolution.

Honestly, I now believe the error was rather mine, as I could not  
reproduce the case, and checked even with 32 bits GNAT, `root_integer` is  
64 bits width, according to the System package. Or else, may be this was  
the effect of an operator which was visible/invisible due to some `use  
type` added or missing (I've changed so much things since).


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-06  8:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-06  1:23 How to flag implicit conversions? Yannick Duchêne (Hibou57)
2013-05-06  5:59 ` J-P. Rosen
2013-05-06  8:25   ` Yannick Duchêne (Hibou57)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox