Cocoalumberjack: Compiler warning: block implicitly retains `self`

Created on 8 Apr 2018  路  6Comments  路  Source: CocoaLumberjack/CocoaLumberjack

New Issue Checklist

Issue Info

Info | Value |
-------------------------|-------------------------------------|
Platform Name | osx
Platform Version | 10.13.4
CocoaLumberjack Version | 3.4.1
Integration Method | cocoapods
Xcode Version | Xcode 9.3
Repro rate | all the time (100%)
Demo project link | N/A

Issue Description and Steps

There are a large number of files which triggers the following warning:

block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior

Maybe it's a good idea to fix these. The full list of files is as follows.

(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:220:22: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            result = _saveThreshold;
                     ^
                     self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:230:17: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            if (_saveThreshold != threshold) {
                ^
                self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:231:17: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                _saveThreshold = threshold;
                ^
                self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:238:22: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                if ((_unsavedCount >= _saveThreshold) && (_saveThreshold > 0)) {
                     ^
                     self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:238:39: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                if ((_unsavedCount >= _saveThreshold) && (_saveThreshold > 0)) {
                                      ^
                                      self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:238:59: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                if ((_unsavedCount >= _saveThreshold) && (_saveThreshold > 0)) {
                                                          ^
                                                          self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:280:22: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            result = _saveInterval;
                     ^
                     self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:293:62: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            if (/* saveInterval != interval */ islessgreater(_saveInterval, interval)) {
                                                             ^
                                                             self->
In module 'Darwin' imported from (PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:17:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/math.h:561:54: note: expanded from macro 'islessgreater'
#define islessgreater(x, y) __builtin_islessgreater((x),(y))
                                                     ^
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:294:17: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                _saveInterval = interval;
                ^
                self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:309:21: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                if (_saveInterval > 0.0) {
                    ^
                    self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:310:25: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                    if (_saveTimer == NULL) {
                        ^
                        self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:327:28: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                } else if (_saveTimer) {
                           ^
                           self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:371:22: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            result = _maxAge;
                     ^
                     self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:384:56: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            if (/* maxAge != interval */ islessgreater(_maxAge, interval)) {
                                                       ^
                                                       self->
In module 'Darwin' imported from (PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:17:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/math.h:561:54: note: expanded from macro 'islessgreater'
#define islessgreater(x, y) __builtin_islessgreater((x),(y))
                                                     ^
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:385:44: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                NSTimeInterval oldMaxAge = _maxAge;
                                           ^
                                           self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:388:17: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                _maxAge = interval;
                ^
                self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:423:25: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                    if (_deleteTimer) {
                        ^
                        self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:468:22: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            result = _deleteInterval;
                     ^
                     self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:481:64: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            if (/* deleteInterval != interval */ islessgreater(_deleteInterval, interval)) {
                                                               ^
                                                               self->
In module 'Darwin' imported from (PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:17:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/math.h:561:54: note: expanded from macro 'islessgreater'
#define islessgreater(x, y) __builtin_islessgreater((x),(y))
                                                     ^
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:482:17: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                _deleteInterval = interval;
                ^
                self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:497:21: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                if (_deleteInterval > 0.0) {
                    ^
                    self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:498:25: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                    if (_deleteTimer == NULL) {
                        ^
                        self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:514:28: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                } else if (_deleteTimer) {
                           ^
                           self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:558:22: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
            result = _deleteOnEverySave;
                     ^
                     self->
(PROJECT_ROOT)/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.m:567:9: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
        _deleteOnEverySave = flag;
        ^
        self->
25 warnings generated.

Most helpful comment

@nekrich thanks for the help. With your push, I did the minimal effort and released 3.4.2. Sorry we're all caught up with other projects and have fallen behind with CocoaLumberjack maintenance. Hope to catch up soon

All 6 comments

@adib

This warning should be fixed by #915 .
It has already been merged into master branch, but not released yet.

Thanks.

Hi @sushichop,
Do you plan to release a 3.4.2 including this fix ?

@jdrevet
I don't know...
But, IMO, this fix should be included in next release because these warnings are a lot, you know.

@bpoplauschi @rivera-ernesto
Would you mind replying to him/her about the following ?

Do you plan to release a 3.4.2 including this fix ?

Thanks in advance.

I am planning to release an update, but I don't know exactly when I'll find the time. You guys can help if you want

@bpoplauschi
I hope #929 with an open release date will help you to make a release a little bit faster, but it includes #928 in the changelog

@nekrich thanks for the help. With your push, I did the minimal effort and released 3.4.2. Sorry we're all caught up with other projects and have fallen behind with CocoaLumberjack maintenance. Hope to catch up soon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nathan187 picture Nathan187  路  7Comments

anker-eric picture anker-eric  路  7Comments

ckrey picture ckrey  路  9Comments

dpbataller picture dpbataller  路  9Comments

tinder-owenthomas picture tinder-owenthomas  路  13Comments