Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staticcheck: check alignment of variables used in atomic accesses #171

Closed
dominikh opened this issue Sep 15, 2017 · 3 comments
Closed

staticcheck: check alignment of variables used in atomic accesses #171

dominikh opened this issue Sep 15, 2017 · 3 comments

Comments

@dominikh
Copy link
Owner

dominikh commented Sep 15, 2017

(Copied from dominikh/go-staticcheck#15, originally by @dgryski)

From sync/atomic:

On both ARM and x86-32, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically. The first word in a global variable or in an allocated struct or slice can be relied upon to be 64-bit aligned.

This should be possible to diagnose statically and warn about.

@dgryski
Copy link

dgryski commented Oct 31, 2018

Dup of golang/go#11891

@dgryski
Copy link

dgryski commented Jan 21, 2019

Fix in vet with golang/tools@24cd39e

@dominikh
Copy link
Owner Author

Better late than never, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants