-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Breakage with restrict qualifier #477
Comments
Not sure where or how to fix. I did a quick Now it could be breathe does something funny with the signature prior to passing it so sphinx, but based upon the errors you posted I suspect sphinx's C++ domain does currently not support the restrict keyword. See A somewhat ugly but mostly functional workaround is adding the following to your doxyfile:
|
Yeah, the error is definitely coming from Sphinx, but I see explicit code in Breathe to handle other type qualifiers and I haven't dug into the source deep enough to know exactly what representation Breathe is handing off to My code is actually C, but I don't know if Breathe can be used with |
If I remember correctly adding The C domain isn't as mature as the C++ domain though, so you may experience problems. At the same time I must say that I've been using it without any issues for quite a long time, excluding the restrict workaround. Edit: I would like the above to be default, but I know many projects use |
Breathe and/or Sphinx lacks support for restrict qualifiers, so use the workaround suggested here to hide the restrict qualifier from Breathe/Sphinx. breathe-doc/breathe#477 (comment)
Hmm, that mostly works, but enums of the form typedef enum {
FOO_A = 1,
FOO_B = 2,
FOO_C = 4,
} FooMode; are reduced to the integer literals |
Breathe and/or Sphinx lacks support for restrict qualifiers, so use the workaround suggested here to hide the restrict qualifier from Breathe/Sphinx. breathe-doc/breathe#477 (comment) An alternative is to use the C domain for *.c and *.h files. This handles restrict, but reduces enum names to their numeric value. Once that Breathe/Sphinx bug is fixed, we could skip the restrict elision in favor of using the C domain.
Breathe and/or Sphinx lacks support for restrict qualifiers, so use the workaround suggested here to hide the restrict qualifier from Breathe/Sphinx. breathe-doc/breathe#477 (comment) An alternative is to use the C domain for *.c and *.h files. This handles restrict, but reduces enum names to their numeric value. Once that Breathe/Sphinx bug is fixed, we could skip the restrict elision in favor of using the C domain.
Breathe and/or Sphinx lacks support for restrict qualifiers, so use the workaround suggested here to hide the restrict qualifier from Breathe/Sphinx. breathe-doc/breathe#477 (comment) An alternative is to use the C domain for *.c and *.h files. This handles restrict, but reduces enum names to their numeric value. Once that Breathe/Sphinx bug is fixed, we could skip the restrict elision in favor of using the C domain.
@jedbrown Sphinx 3 has a mostly rewritten C domain, which Breathe >= 4.15.0 uses (hopefully somewhat) properly. There is a significant chance the problem is (partially) fixed with this. If you have the time could you check again? |
This might be fixed with #512, released in Breathe v4.17.0. Note that you also need Sphinx 3.x for recent Breathe versions. Could someone try and post results? |
Thanks! This typedef rendering looks fine to me: https://libceed.readthedocs.io/en/jed-breathe-4.17/api/CeedBasis/#typedefs-and-enumerations |
@jedbrown I also believe the |
@jedbrown Nice, looks like it is working properly and rendering in the idiomatic way. I do notice there is one space too many after the The Thanks for testing, good to know restrict works too now. |
We're using Breathe on a C99 project that uses
restrict
qualifiers. This causes error messages emanating from Sphinx (sphinx/domains/cpp.py
), but it's unclear to me whether a fix needs to go into Breathe or Sphinx.I can get a clean build by stripping
restrict
out of the XML files produced by Doxygen.I can take a crack at fixing, but will likely be more efficient if you have any tips for where it should be handled. Breathe has some code for other qualifiers, such as
volatile
, so I assume it'll need something forrestrict
too. The relevant XML from my case is below.The text was updated successfully, but these errors were encountered: