Skip to content

Macro Redefinition in MSVC compatibility mode #11955

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
llvmbot opened this issue Dec 15, 2011 · 3 comments
Closed

Macro Redefinition in MSVC compatibility mode #11955

llvmbot opened this issue Dec 15, 2011 · 3 comments
Labels
bugzilla Issues migrated from bugzilla c++ wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@llvmbot
Copy link
Member

llvmbot commented Dec 15, 2011

Bugzilla Link 11583
Resolution WONTFIX
Resolved on Sep 21, 2015 21:58
Version trunk
OS Windows XP
Blocks llvm/llvm-bugzilla-archive#13707
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@tritao,@nico

Extended Description

In code containing function-like macro overloading, for example:

#define RETERROR(x) return x
#define RETERROR(x,y) return x + 1

int test()
{
RETERROR(2);
}

Visual C++ compiler is able to processes this code, generating the C4003 warning (the missing argument being replaced by an empty string), while clang exits with an error "too few arguments provided to function-like macro invocation", being unable to process it and potentially making some Visual C++ projects uncompilable.

@DougGregor
Copy link
Contributor

It's not clear to me that we'll ever want to support this in Clang, because absolute compatibility with MSVC is not a goal for the project. If this shows up in platform headers somewhere, then it might be worth doing.

@nico
Copy link
Contributor

nico commented Sep 22, 2015

Looks like this isn't needed to parse any system headers.

@tritao
Copy link
Mannequin

tritao mannequin commented Nov 26, 2021

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

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++ wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

4 participants