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

Microsoft specific handling of variadic macros not supported #843

Closed
Bertk opened this issue Apr 24, 2016 · 2 comments
Closed

Microsoft specific handling of variadic macros not supported #843

Bertk opened this issue Apr 24, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@Bertk
Copy link
Contributor

Bertk commented Apr 24, 2016

The sample variadic_macros.cpp from MSDN fails with com.sonar.sslr.api.RecognitionException

#define MACRO(s, ...) printf(s, __VA_ARGS__)

int main() {
    MACRO("hello, world\n");
}

The syntax tree is created for the next code sample but error messages are shown:

#define EMPTY
#define MACRO(s, ...) printf(s, __VA_ARGS__)

int main() {
    MACRO("error\n", EMPTY);  // would cause error C2059, except VC++ 
                              // suppresses the trailing comma
}

e.g.

08:22:26.021 [AWT-EventQueue-0] ERROR CxxPreprocessor - Mismatch: expected ',' got: ')'
@Bertk Bertk added the bug label Apr 24, 2016
@Bertk
Copy link
Contributor Author

Bertk commented May 1, 2016

@guwirth I have a solution proposal for this (b7c588a). Please review and send me your feedback.
There is still an issue with the BOOST_PP_STRINGIZE which I want to analyze. But this doesn't belog to variadic macros ...

INFO: [D:\Workspaces\xxx\boost\include\boost\mpl\list.hpp:36]: cannot parse included filename: BOOST_PP_STRINGIZE(boost/mpl/list/list20.hpp)'
INFO: [D:\Workspaces\xxx\boost\include\boost\mpl\list.hpp:36]: cannot find the sources for '#   include BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_HEADER)'
INFO: [D:\Workspaces\xxx\boost\include\boost\mpl\vector.hpp:36]: cannot parse included filename: BOOST_PP_STRINGIZE(boost/mpl/vector/vector20.hpp)'
INFO: [D:\Workspaces\xxx\boost\include\boost\mpl\vector.hpp:36]: cannot find the sources for '#   include BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_HEADER)'

@Bertk
Copy link
Contributor Author

Bertk commented May 5, 2016

This issue is solved with PR #853

@Bertk Bertk closed this as completed May 5, 2016
@guwirth guwirth added this to the 0.9.6 milestone May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants