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

warn when int or uint is used in a native type decl #1403

Closed
nikomatsakis opened this issue Dec 31, 2011 · 3 comments
Closed

warn when int or uint is used in a native type decl #1403

nikomatsakis opened this issue Dec 31, 2011 · 3 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@nikomatsakis
Copy link
Contributor

Perhaps we should issue a warning---or even an error?---when int or uint is used in a native type declaration? It is a very common mistake to assume they are the same as the C types int and unsigned. We could suggest the use of ctypes::c_int or ctypes::long etc.

@jckarter
Copy link

You'd want to make sure the warning doesn't trigger when referring to Rust int by the ctypes::ptrint_t alias.

@nikomatsakis
Copy link
Contributor Author

Yes, I would only trigger the warning if the user literally typed int or uint. In other words, base the warning on the ast::ty (AST), not on the ty::t (resolved type).

@lht
Copy link
Contributor

lht commented Jan 18, 2012

Closed by commits:

f03eb96 rustc: Warn when int or uint is used in a native type decl
dde4186 Use ctypes in native function declarations
04882d7 rustc: Use integer from ctypes consistently
7b1724f libstd: Revert an integer type casting

@lht lht closed this as completed Jan 18, 2012
bjorn3 added a commit to bjorn3/rust that referenced this issue Oct 29, 2023
…assembler

Support and stabilize inline asm on all platforms
bjorn3 added a commit to bjorn3/rust that referenced this issue Nov 10, 2023
rust-lang#1403 extended support to all targets supported by cg_clif
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Added jq for json querying.

* Added clippy to regression.

* Added error ignore and todo to kani-compiler.

* Added clippy todo to cprover_bindings.

* Forced failure on warnings (Werror for clippy).

* Added clippy todo to compiletest.

* Clippy supression for bookrunner.

* Resolved metadata warnings with publish = false.

* Clippy todo for kani library.

* Clippy todos and publish fix for kani_macros.

* Cargo fmt.

* Temporally turned off clippy fail.

* Moved clippy to format checks.

* Moved clippy to the format check.

* Added missing dependency.

* Fixed yaml overwrite problem.

* Gather stats on clippy warnings.

* jq install for osx not needed.

* Moved clippy control to a central config file.

* Fixed clippy warnings under library/

* Adjusted actions to print stats by removing lint supression.

* Ignored 3 clippy warnings that regressed after merge.

* Forgot to remove manual -A

* got rid of redundant allowed lints.

* Moved jq install to workflow side.

* removed .cargo from gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants