-
Notifications
You must be signed in to change notification settings - Fork 175
[WIP] Add better C support #135
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
base: main
Are you sure you want to change the base?
Conversation
…n alias for C++'s thread_local
… in compile_commands.json
…nstants for backwards compat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, just one nitpick.
|
Thanks a lot already! I'd like to split the changes up into separate PRs, to enable a cleaner commit history later on. Can you do one that adds basic C support, one that adds register, one for atomic, and so on.
Yes, cppast's code generator uses |
|
Sorry about the silence, but I've only now had another chance to look at this. I've added the logic required to generate I still want to find a way to make docs on |
|
@staticintlucas Any progress on this? It would be really cool to use your hard work :) |
|
Sorry, got distracted with other projects and completely forgot about this. I can create some PRs for what I've already implemented in the coming days. I had not made any progress with |
|
@foonathan is there any reason you want him to create separate PR's rather than just cleaning up the commit history in this one with a rebase? Personally, I don't see the difference. |
I usually rewrite the commit messages when merging. This is easier when it's separate PRs. |
Better C support as discussed in standardese/standardese#220.
Added:
restrict&_Atomicqualifiersregisterstorage class_Thread_localas an alias for C++'sthread_localAlso fixed an issue that was causing my
compile_commands.jsonto parse incorrectly. It was treating... -std=c17 filename.cas iffilename.cwas the value for-std=c17rather than splitting-std=c17and treatingfilename.cas a positional argument.This PR is still a work in progress, but I think most of the changes required for C support are there if you want to review them. I have generally kept naming as is, so
cpp_standardnow includes both C and C++ standards, andcpp_cvhas all 4 qualifiers, not just const and volatile.I still have some issues using Standardese with some of my C code. For example:
This generates documentation for the anonymous struct rather than the typedef. An easy workaround is:
But in this case the docs show
using name_t = _name;which is only valid in C++, rather than a typedef which is standard C.I haven't looked into these remaining issues yet; if they originate from foonathan/cppast or whether only standardese/standardese needs some more changes.