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

Modifies to work with gcc 4.8 for el7 #5847

Closed
wants to merge 1 commit into from

Conversation

cskeeters
Copy link

This change enables parsers/scanners to work on the version of gcc that comes with el7 (RHEL7/Oracle Linux 7), which is 4.8. I assume later versions of gcc set c99 as the default standard and that's why it's not required.

The parser/scanners for most languages compile with clang 3.2.4. I set it up with this added to my init function in Lazy's configuration for treesitter.

require'nvim-treesitter.install'.compilers = { "clang" }

Unfortunately, the vim parser doesn't compile. Instead of throwing an error, it never finishes compiling. Strange; not going to investigate. For me, the best option was to use gcc and add this argument.

Would adding this argument be detrimental to compilation on newer versions of gcc? I don't know. Please don't feel obligated to take this patch. I'm just offering it and want to make it findable for anyone else having the same issue.

@clason
Copy link
Contributor

clason commented Jan 2, 2024

Unfortunately, this will break mixed language parsers, which we still have some of.

@clason
Copy link
Contributor

clason commented Jan 2, 2024

And I regret to say we are not interested in supporting such old compilers; it is hard enough to support current compilers on all platforms...

@clason
Copy link
Contributor

clason commented Jan 2, 2024

But the offer is appreciated!

@ObserverOfTime
Copy link
Member

You can set CC to a script file that passes the argument to gcc.

#!/usr/bin/sh

exec gcc --std=c99 "$@"

@clason clason closed this Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants