Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to flag implicit conversions?

30 views
Skip to first unread message

Yannick Duchêne (Hibou57)

unread,
May 5, 2013, 9:23:23 PM5/5/13
to
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

J-P. Rosen

unread,
May 6, 2013, 1:59:42 AM5/6/13
to
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

Yannick Duchêne (Hibou57)

unread,
May 6, 2013, 4:25:23 AM5/6/13
to
Le Mon, 06 May 2013 07:59:42 +0200, J-P. Rosen <ro...@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).
0 new messages