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

Rustc generates wrong calling convention for WinMain #8510

Closed
klutzy opened this issue Aug 14, 2013 · 2 comments
Closed

Rustc generates wrong calling convention for WinMain #8510

klutzy opened this issue Aug 14, 2013 · 2 comments
Labels
O-windows Operating system: Windows

Comments

@klutzy
Copy link
Contributor

klutzy commented Aug 14, 2013

Currently rustc generates WinMain function with cdecl calling convention (src/librustc/middle/trans/base.rs), but Win32 API docs say stdcall is right.
Linker works because we actually export it as "WinMain@16", but I think it's a hack and should be fixed.

@brson
Copy link
Contributor

brson commented Aug 15, 2013

Interesting!

@klutzy
Copy link
Contributor Author

klutzy commented Aug 28, 2013

After some investigation: it is okay to use main for mingw gcc. It's independent of gui/console (see note below).
I've patched locally to use main regardless of platform (except for android who use amain), and built stage2 with no problem. I'll make pr after make check-fast.

Note on GUI:

for gcc: to make GUI rust application, pass --link-args "-Wl,--subsystem,windows" to rustc. It is independent to this issue; it works already. (example)
More info: http://gcc.gnu.org/ml/gcc-help/2004-01/msg00223.html

for msvc (#1768): winsdk linker accepts /subsystem:{console,windows} for console/gui configuration. However, linker tries to find only one of main/WinMain depending on the option.
But it is possible to override by passing /entry:{mainCRTStartup,WinMainCRTStartup} to linker, so it is not a big problem.

bors added a commit that referenced this issue Aug 28, 2013
@bors bors closed this as completed in eaa5658 Aug 28, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
…xFrednet

Use URL parameters for filter states

This fixes rust-lang#8510 by storing Clippy Lints page filter configuration in the URL parameters.

This includes:
- Lint levels
- Lint groups
- Version filters

"Filter" was already present in the URL and its behavior is retained. There is existing support for passing a `sel` query parameter; this is also retained, but I am not sure if it used in the wild.

The URL parameters only get included if they are modified after loading the page.

I have these changes available here in case people want to play with it: https://whee.github.io/rust-clippy/master/

An example with levels, groups, and versions set (oddly):

https://whee.github.io/rust-clippy/master/#/?groups=pedantic,perf&levels=allow,warn&versions=gte:53,lte:57,eq:54

Adding a filter:

https://whee.github.io/rust-clippy/master/#/manual_str_repeat?groups=pedantic,perf&levels=allow,warn&versions=gte:53,lte:57,eq:54

---

changelog: Docs: [`Clippy's lint list`] now stores filter parameters in the URL, to allow easy sharing
[rust-lang#10834](rust-lang/rust-clippy#10834)
<!-- changelog_checked -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants