int-conversion warning ignored for BOOL on arm64 architecture

Originator:kent.humphries
Number:rdar://19970165 Date Originated:26-Feb-2015
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.1.1
Classification:Other Bugs Reproducible:Always
 
Kent Humphries

26-Feb-2015 04:41 PM

Summary:
This is likely a compiler issue rather than an Xcode issue, but it manifests itself when building projects from Xcode.

Our app project includes two build configurations. One configuration builds for all architectures, one builds for active architectures only.

When building for active architecture (simulator on x86_64 architecture), build runs and compiles without warnings. When building for all architectures (which includes armv7), warning is generated for int-conversion.

The culprit code is:

    BOOL myBool = [self performSelector:@selector(methodThatReturnsBool)];

Effectively, this potential bug in code (it rightly warrants an int-conversion warning) is hidden on arm64 and x86_64 (possibly others too) architectures.

Note that the following code:

    int myInt = [self performSelector:@selector(methodThatReturnsBool)];

Does generate an int-conversion warning on all architectures tested.

We wish to have reliable warnings generated across build configurations, irrespective of the build architecture.

Thank you for your time.

Steps to Reproduce:
1. Download attached sample project: int-coversion. <https://github.com/kenthumphries/int-conversion-demo>
2. Setup provisioning so that project can be run on a device.
3. Run the app on an armv7 architecture - int-conversion warning prevents compilation. [OK]
4. Run the app on an arm64 architecture - int-conversion warning not generated [NOT OK]

Expected Results:
On every architecture, implicitly converting an id to a BOOL should cause a warning to be generated.

Actual Results:
On architecture armv7, int-conversion warning is generated.
On architecture arm64, int-conversion warning is not generated.

Version:
Xcode 6.1.1
OS X 10.10.1

Notes:


Configuration:

Comments

Response from Apple

Duplicate of 17728969 (Open)

By kent.humphries at March 2, 2015, 9:30 a.m. (reply...)

Response from Apple

Duplicate of 17728969 (Open)

By kent.humphries at March 2, 2015, 9:30 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!