Objective-C @(boolValue) is causing a code smell

Objective-C has a shorthand for creating an NSNumber from a BOOL (or other number) like so: @(myBoolValue)

This cause SonarCloud to claim it’s a code smell and suggests removing the parenthesis. Doing so causes an Objective-C compilation error: Unexpected @ in program

Is this a false positive?

Many thanks,
—Josh

Hi @JoshParadroid ,

thank you for your report, I created a ticket to fix the false positive: CPP-3284.

1 Like