Skip to content

Implement fixits for malformed 'main' declaration #8476

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

Closed
ggreif opened this issue Sep 7, 2010 · 6 comments
Closed

Implement fixits for malformed 'main' declaration #8476

ggreif opened this issue Sep 7, 2010 · 6 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer confirmed Verified by a second party

Comments

@ggreif
Copy link
Contributor

ggreif commented Sep 7, 2010

Bugzilla Link 8104
Version trunk
OS All
CC @dwblaikie,@gribozavr

Extended Description

[7:30pm] gabor: dgregor: FixIt idea: error: C++ requires a type specifier for all declarations
[7:30pm] gabor: main (int , const char * argv [])
[7:30pm] gabor: ^--- "int "

Since main must return "int" this is an always applicable fixit.

I am not so sure with the main arguments

  • either "int main(void)" in C++ also "int main()"
  • or "int main(int argc, const char* argv[])"

But these are often mis-declared, so a fixit would be useful too.

@ggreif
Copy link
Contributor Author

ggreif commented Sep 7, 2010

assigned to @dwblaikie

@dwblaikie
Copy link
Collaborator

I've made some progress on this already. r139282 implements fixits for declaring main 'virtual' and 'static'.

I'm also going to resolve llvm/llvm-bugzilla-archive#8269 as fixed/no repro because clang no longer suggests the wrong fixit (for the return type of main). In fact, it doesn't suggest any fixit at all - we should address that in this bug.

[assigning to myself since this bug is fairly old & seems untouched, so I assume it's not being actively worked on by the person currently assigned]

@dwblaikie
Copy link
Collaborator

Dmitri addressed another part of this in r172684, providing a fixit for an incorrect return type.

@gribozavr
Copy link
Collaborator

Added a fixit for _Noreturn in r173024.

@dwblaikie
Copy link
Collaborator

mentioned in issue llvm/llvm-bugzilla-archive#8269

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@llvmbot llvmbot added the confirmed Verified by a second party label Jan 26, 2022
@philnik777
Copy link
Contributor

There are quite a few fixits now for misdeclared mains, so I think this can be closed.

@EugeneZelenko EugeneZelenko added clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer and removed clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Apr 25, 2023
Michael137 pushed a commit to Michael137/llvm-project that referenced this issue Apr 2, 2024
…-in-memory-6.0

[lldb] [ObjectFileMachO] LLVM_COV is not mapped into firmware memory (llvm#86359)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer confirmed Verified by a second party
Projects
None yet
Development

No branches or pull requests

6 participants