-
Notifications
You must be signed in to change notification settings - Fork 13.5k
clang-cl should be compatible to cl.exe
regarding extern "C"
handling in namespaces
#24569
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
Comments
This does fall under the general category of things we can do for compatibility. We can probably pattern match this case in the decl merging machinery. Today we say they have different types, but the user code would probably be fine if we just ignored the second declaration with a warning. |
Aside, I assume that workaround in boost is the introduction of BOOST_USE_WINDOWS_H which, when defined, includes the real windows.h header instead of the extern "C" equivalents declared in a boost namespace. This is however not always acceptable or a viable option when using clang-cl on an existing code base using boost, as this suddenly exposes all the windows.h preprocessor nasties to the complete code base. This can result in a huge fallout. If this could be resolved under the hood of ms-extensions/ms-compatibility that would be a much better situation. |
cl.exe
regarding extern "C"
handling in namespaces
Duplicate of #95681 |
@llvm/issue-subscribers-clang-frontend Author: None (24bb07d4-a064-4a64-856b-dc3103e7a3ac)
| | |
| --- | --- |
| Bugzilla Link | [24195](https://llvm.org/bz24195) |
| Version | trunk |
| OS | All |
| Blocks | llvm/llvm-project#14079 |
| CC | @XVilka,@DougGregor,@rnk |
Extended DescriptionHello, I try to use libclang to parse some source files. But the error is also visible in clang-cl (r242653 nightly build). The error originates from boost interprocess headers which declare windows.h functions different than windows.h. The error got a work-around in later boost versions but unfortunately we are stuck with 1.50 for a while. It boils down to Visual Studio Compiler accepting the following, but clang-cl does not: extern "C" void foo(int a);
namespace bar {
extern "C" void foo(long b);
} In the boost case the functions get pointers to different structures. Could you modify clang to accept this oddity with enabled Thanks, |
Extended Description
Hello,
I try to use libclang to parse some source files. But the error is also visible in clang-cl (r242653 nightly build).
The error originates from boost interprocess headers which declare windows.h functions different than windows.h. The error got a work-around in later boost versions but unfortunately we are stuck with 1.50 for a while.
It boils down to Visual Studio Compiler accepting the following, but clang-cl does not:
In the boost case the functions get pointers to different structures.
Could you modify clang to accept this oddity with enabled
ms-extensions
/ms-compatibility
likecl.exe
does?Thanks,
Gregor
The text was updated successfully, but these errors were encountered: