09-01-2008, 04:43 PM
Hi pkruk
Re-writing the rule into a list of positives, I think we get.
Conversions can be performed between a pointer to object and an integral type. But see 11.3 - also requires a cast.
Conversions can be performed between a pointer to object and another pointer to object type. But see 11.4 also requires a cast.
Conversions can be performed between a pointer to object and a pointer to void. Cast not required.
All other conversions are not allowed.
Therefore the following is true.
Conversions shall not be performed between a pointer to any and a float type.
Having said that, is there ever a case when you would want to convert an address to a floating point number? Do remember that not all binary patterns are legal floating point numbers, and (certain) processors can reset on such patterns.
George
Re-writing the rule into a list of positives, I think we get.
Conversions can be performed between a pointer to object and an integral type. But see 11.3 - also requires a cast.
Conversions can be performed between a pointer to object and another pointer to object type. But see 11.4 also requires a cast.
Conversions can be performed between a pointer to object and a pointer to void. Cast not required.
All other conversions are not allowed.
Therefore the following is true.
Conversions shall not be performed between a pointer to any and a float type.
Having said that, is there ever a case when you would want to convert an address to a floating point number? Do remember that not all binary patterns are legal floating point numbers, and (certain) processors can reset on such patterns.
George