DaveWoodCom / XCGLogger

A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overlapping accesses to 'data' (Xcode 10 beta, Swift 4.2)

yvbeek opened this issue · comments

In Xcode 10 beta with Swift 4.2 there are two build errors, in URL+XCGAdditions.swift (line 26 and 64):

Overlapping accesses to 'data', but modification requires exclusive access; consider copying to a local variable

image

I think the issue is that you are referring to data inside of the withUnsafeMutableBytes block. The block is reading the data variable (with data.count) while it is modifying the data variable.

A potential fix would be to replace data with $0.pointee, but I'm not sure if that is just hiding the problem. Perhaps it would be better to extract the data.count into a separate variable before you enter the block and use that inside the block.

This is actually already fixed on master.
There would need to be a release done w/ cocoapods in order to update dependencies easily ?

We will wait for updates for cocoapods

Any news on this?

Actually the data.count can be replaced with lenght :)

6.0.4 is now available as a pod etc. Fixes these issues (and a few more).

I am getting the same error in Xcode 10.1
My pod version: 1.7.0.beta.3
Anyone can sagest me
Screenshot 2019-04-11 at 12 46 57 AM

Hi @mithun-grmtech, you are most likely using the wrong version of XCGLogger.
If you're using Xcode 10.1, you should be using version 6.1.0 of XCGLogger, so make sure you specify that in your Podfile:

pod 'XCGLogger', '~> 6.1.0'

If you're still having issues after this, please ask a question on StackOverflow, and include the contents of your Podfile.

Hi @DaveWoodCom, Thank you
Now it's working fine.
👍