Comments (9)
The warning GCC_WARN_UNUSED_PARAMETER could be added as well. iOS default is YES.
from xcconfigs.
Right - I just looked over the list in Xcode and there are actually quite a few which we haven't overwritten with the Default Value (maybe ~10-20%). I'm not sure we should. What's your thought on which ones to overwrite, which ones to leave the default (which comes in handy, if Apple ever changes them BTW :-))
from xcconfigs.
Personally I think it‘s nice to have all settings in xcconfigs, even when they overwrite defaults, since I can quickly find them and change them temporarily. But apart from that there‘s not much value in it. When Apple decides to change a default, it will have a good reason (if that ever happens).
from xcconfigs.
Hey @fabb, thanks for the clarification!
My workflow is actually changing overwrites in the xcodeprojects, and the xcconfigs are basically my better "Apple-defaults".
I'd suggest we leave out defaults that we don't think should be changed, and focus on the stuff we think we know better 😆
from xcconfigs.
Fine with me!
So back to GCC_WARN_UNUSED_PARAMETER
: should we activate it? It might be annoying for a few unused parameters in delegate methods, but apart from that it helps to keep the code clean.
from xcconfigs.
I just enabled it here for the fun of it, and I think it does not work well together with Objective-C.
Combined with our Warnings-As-Errors, all those warnings become must-fixs. And given the parameter name often has information, it can't be removed, and commenting it with /* name */
might be too tedious?
I do remember having it enabled for my C++ projects, and using the commenting style above - but the style looks off for me in Objective-C. I can't recall having it seen it before as well.
Omitting the unused parameter names altogether looks to me even more off to me. :-)
I see those are mostly style arguments, but nevertheless, have you seen the commented / omitted Objective-C parameter names often?
from xcconfigs.
I‘m not really sure in which cases you would like to keep unused parameters at all, do you have some examples?
Fyi you can use __unused
to annotate unused parameters that should not trigger the warning.
from xcconfigs.
Good call with __unused
, thanks!
And sure, on the sample project I tried, I got around 300 warnings by enabling it. Here are some of them:
xxx:303:60: warning: unused parameter 'scrollView' [-Wunused-parameter]
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
^
xxx:312:44: warning: unused parameter 'collectionView' [-Wunused-parameter]
- (BOOL)collectionView:(UICollectionView *)collectionView shouldHighlightItemAtIndexPath:(NSIndexPath *)indexPath
^
xxx:312:105: warning: unused parameter 'indexPath' [-Wunused-parameter]
- (BOOL)collectionView:(UICollectionView *)collectionView shouldHighlightItemAtIndexPath:(NSIndexPath *)indexPath
^
xxx:318:44: warning: unused parameter 'collectionView' [-Wunused-parameter]
- (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath
^
xxx:318:102: warning: unused parameter 'indexPath' [-Wunused-parameter]
- (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath
^
xxx:324:44: warning: unused parameter 'collectionView' [-Wunused-parameter]
- (BOOL)collectionView:(UICollectionView *)collectionView shouldDeselectItemAtIndexPath:(NSIndexPath *)indexPath
I wouldn't wanna flip this switch... :-)
from xcconfigs.
Ok, no problem.
from xcconfigs.
Related Issues (20)
- Xconfigs
- CocoaPods support HOT 1
- ENABLE_TESTABILITY HOT 2
- GCC_NO_COMMON_BLOCKS HOT 5
- Needs an updated tag HOT 8
- New Tag HOT 1
- New Tag HOT 2
- New tag/release HOT 5
- Add -Wpartial-availability HOT 3
- Add CLANG_WARN_NON_LITERAL_NULL_CONVERSION HOT 3
- Add CLANG_WARN_OBJC_LITERAL_CONVERSION HOT 3
- Add -Wunguarded-availability HOT 2
- New release for Xcode 9 HOT 4
- $(inherited) vs. New Xcode Build System HOT 5
- New release for Xcode 9.3 HOT 2
- Consistent Platform Naming HOT 11
- Xcode 10, swift 4.2.1 HOT 6
- Update with new warnings HOT 4
- bump to version >= 1.0 runs into error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcconfigs.