Skip to content

Cast from pointer to smaller type loses information #1314

Open
@borogove

Description

@borogove

Cocos2d-spritebuilder 3.4.3.

In CCTMXXMLParser.m, line 500:

inflatedLen = (int)&inflatedLen; // XXX: to avoid warings in compiler

This looks like a pretty shady suppression of an unused variable warning (casting to void is preferable).

I'm building an Objective-C++ project, which seems to have different casting rules, so this is a fatal compilation error:
Cast from pointer to smaller type 'int' loses information

There are a number of other casting errors across the codebase in Objective-C++ mode. This thread from October 2014 toyed with the idea of adding Objective-C++ source to the tests: http://forum.cocos2d-spritebuilder.org/t/cocos3d-c-mm-files-compiler-issue/15570/3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions