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

Parser Option "ParseAsCpp" problem when parsing as C #47

Open
danyhm opened this issue May 15, 2021 · 2 comments
Open

Parser Option "ParseAsCpp" problem when parsing as C #47

danyhm opened this issue May 15, 2021 · 2 comments
Labels
question Further information is requested

Comments

@danyhm
Copy link

danyhm commented May 15, 2021

Hello,

if the parser option ParseAsCpp is set to false, the compilation is always returned empty regardless of the input files or texts.

Is Parsing as C not supported?

@xoofx xoofx added the question Further information is requested label Feb 13, 2022
@waldnercharles
Copy link
Contributor

waldnercharles commented Mar 8, 2022

Not sure if this is a bug. It looks like CppParser just excludes passing the -xc++ option to clang if ParseAsCpp is false. I think you can work around it for now by passing -xc or --language=c into AdditionalArguments.

var options = new CSharpConverterOptions();
options.AdditionalArguments.Add("--language=c");

@xoofx
Copy link
Owner

xoofx commented Mar 9, 2022

Correct, ParseAsCpp is doing this:

if (options.ParseAsCpp && !arguments.Contains("-xc++"))
{
arguments.Add("-xc++");
}

But you can pass other arguments to clang directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants