RE: [sv-bc] static casting vs bit-stream casting

From: Rich, Dave <Dave_Rich@mentor.com>
Date: Wed Sep 18 2013 - 08:02:21 PDT
Actually, bit-stream casting is a static cast, and static casting only works when there are rules explaining how assignments are made between the types. If there are no explicit rules, the cast is illegal. See 6.22.4 Cast compatible


Dave 
Mentor Graphics


-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Daniel Mlynek
Sent: Wednesday, September 18, 2013 12:56 AM
To: sv-bc@eda.org
Subject: [sv-bc] static casting vs bit-stream casting

Those 2 features : static casting and  bit-stream casting share same syntax. It depends on the type/expression used before apostrophe which one is used.
IMHO current description need some clearence:

1. Chapter "Bit-stream casting" says "Type casting can also be applied to unpacked arrays and structs." While after reading whole chapter I suppose that at least classes need to be added to this sentence.
It would be also nice to repeat in this chapter that bit stream casting occur if the type of cast and casted variaable are not assignment compatybile

2. Static cast chapter says:
"If the expression is not assignment compatible with the casting type, then if the casting typeis an enumerated type, the behavior shall be as described as in 6.19.4, and if the casting type is a bit-stream type, the behavior shall be as described in 6.24.3."
But do not explain what to do if the expression is not assignment compatible with the casting type and is not enum nor bit-stream type.


DANiel

--
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Sep 18 08:02:39 2013

This archive was generated by hypermail 2.1.8 : Wed Sep 18 2013 - 08:02:51 PDT