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

Add more warnings and errors. #13

Open
Sean1708 opened this issue Nov 17, 2015 · 1 comment
Open

Add more warnings and errors. #13

Sean1708 opened this issue Nov 17, 2015 · 1 comment

Comments

@Sean1708
Copy link
Owner

But only when it makes sense.

For example a public C function which is not #[no_mangle] is likely that way because the author forgot to include it. On the other hand, a public struct is quite likely to be not intended to be used from C so we don't want to warn about that.

Combinations which should be warned:

  • pub extern <C style ABI> fn with no #[no_mangle]
  • #[no_mangle] pub fn with no extern
  • use of types which are not pointers, function pointers, or paths
@Sean1708 Sean1708 changed the title Add warnings for items which only match some of the inclusion criteria. Add more warnings and errors. Dec 8, 2015
@Sean1708
Copy link
Owner Author

Sean1708 commented Jan 1, 2016

  • Anything marked #[repr(C)] should be public and C-calllable
    • no generics
    • no unit structs
    • single unit tuple structs only (opaque pointers)
  • Anything marked #[no_mangle] should be public and external
  • Anything external should be public and #[no_mangle]
  • Any functions pointers should be extern
    • maybe this should only be applied when in a struct or function args

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

No branches or pull requests

1 participant