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

main() detection doesn't catch a manually defined extern "C" fn main() #638

Open
abonander opened this issue Oct 6, 2020 · 0 comments
Open

Comments

@abonander
Copy link

Playground doesn't detect that the following code has a main() function:

#![no_main]

use std::os::raw::*;

#[no_mangle]
pub extern "C" fn main(argc: c_int, argv: *const *mut c_char) -> c_int {
    println!("Hello from main({}, {:p})", argc, argv);
    0
}

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=736713393bf0a8b9cb307dcc5a46fdc4

This is a pretty niche edge case, so feel free to close this if you don't think it's worth the effort. I didn't see anything mentioning this specific case in the issue tracker so I figured I'd report it.

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