On Wed, 04 Nov 2015 11:52:09 +0100, Bernhard Voelker wrote:
On 11/04/2015 09:52 AM, Dominique Leuenberger / DimStar wrote:
On Wed, 2015-11-04 at 09:01 +0100, Takashi Iwai wrote:
It is OK if it's cast. The returned value itself is same, just a different expression.
Returning a boolean FALSE (0) won't cause an issue - but TRUE? That translates to '1'.
So in fact, you return a pointer on the address 0x1 and hope to get anything useful from there when accessing it.
Sounds in most cases very fatal.
The check is about 64bit portability. If you return (int)1 to a pointer, then the 32 bit int value will be assigned to either the lower or higher part of the 64-bit pointer adress, maybe leaving alone the other part.
It returns the pointer addressing 0x1, and it works no matter whether 32/64bit or LE/BE architectures we care on OBS, at least. You can find tons of codes passing TRUE or any other integer value as a pointer in GNOME. Of course, they have usually explicit cast for avoiding the warning message. Takashi -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org