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

Fix future-incompatibilities warning #5

Closed
wants to merge 1 commit into from
Closed

Fix future-incompatibilities warning #5

wants to merge 1 commit into from

Conversation

felfert
Copy link

@felfert felfert commented Apr 25, 2023

This PR fixes a warning about future-incompatibility.

Details of the warning:

warning: reference to packed field is unaligned
--> /home/felfert/.cargo/registry/src/github.com-1ecc6299db9ec823/uhid-virt-0.0.5/src/codec.rs:187:35
|
187 | let payload = &event.u.start;
| ^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 rust-lang/rust#82523
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use read_unaligned/write_unaligned (loads and stores via *p must be properly aligned even when using raw pointers)
= note: #[allow(unaligned_references)] on by default

@StaticRocket
Copy link

Duplicate of #4

@felfert
Copy link
Author

felfert commented Apr 26, 2023

oops. However it begs the question, if this repo is abandoned. After all, #4 is from last year and the other PRs are even older and none of them has been merged.
Also: The Cargo.toml in this repo has version 0.0.4, while on crates.io the crate has 0.0.5. Strange.

@StaticRocket
Copy link

Yeah, not really sure whats going on. Mentioned that in the other PR and a linked commit. Weird stuff.

@felfert
Copy link
Author

felfert commented Apr 26, 2023

Ha! just compared the repo against the source from crates.io. Turns out, that the Cargo.toml was modified by cargo during upload, so obviously @flukejones just forgot to bump the version before uploading, See for yourself:

diff -uw /home/felfert/.cargo/git/checkouts/uhid-virt-913c9a01cae84a47/9cb5f6f/Cargo.toml /home/felfert/.cargo/registry/src/github.com-1ecc6299db9ec823/uhid-virt-0.0.5/Cargo.toml
--- /home/felfert/.cargo/git/checkouts/uhid-virt-913c9a01cae84a47/9cb5f6f/Cargo.toml	2023-04-25 23:47:05.610510969 +0200
+++ /home/felfert/.cargo/registry/src/github.com-1ecc6299db9ec823/uhid-virt-0.0.5/Cargo.toml	2020-06-30 10:39:10.000000000 +0200
@@ -1,24 +1,36 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies
+#
+# If you believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
 [package]
+edition = "2018"
 name = "uhid-virt"
-version = "0.0.4"
+version = "0.0.5"
 authors = ["Luke Jones <luke@ljones.dev>", "Sameer Puri <purisame@spuri.io>", "Daniel Stiner <danstiner@gmail.com>"]
-edition = "2018"
+exclude = [".travis.yml", "example/"]
 description = "Interface to Linux UHID (user-space HID transport drivers)"
-repository = "https://github.com/flukejones/uhid-virt"
-license = "MIT OR Apache-2.0"
 readme = "README.md"
 keywords = ["hid", "uhid", "linux", "userspace", "transport"]
 categories = ["os", "os::unix-apis"]
-exclude = [
-    ".travis.yml",
-    "example/"
-]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/flukejones/uhid-virt"
 
 [lib]
-doc = true
 test = true
+doc = true
+[dependencies.enumflags2]
+version = "^0.6.4"
+
+[dependencies.libc]
+version = "^0.2.0"
 
-[dependencies]
-uhidrs-sys = "1.0.0"
-enumflags2 = "^0.6.4"
-libc = "^0.2.0"
+[dependencies.uhidrs-sys]
+version = "^1.0.1"

@flukejones
Copy link
Owner

One of the reasons I never used github is because it never had good email notifications. Microsoft must have changed something because this is the first time I've ever received emails. Hell I didn't even know I had outstanding PR's on this.

I've merged #4 so I'll close this.

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

Successfully merging this pull request may close these issues.

3 participants