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

.. doxygenfunction fails to recognize function with restrict keyword in parameters #936

Open
acagliano opened this issue Jul 4, 2023 · 1 comment

Comments

@acagliano
Copy link

Initially posted this issue directly on Doxygen's repo before discovering it was an issue with Breathe, not doxygen.
doxygen/doxygen#10170

The function prototype I am attempting to import is this:
void cryptx_hazmat_powmod(uint8_t size, uint8_t *restrict base, uint24_t exp, const uint8_t *restrict mod);

When attempting to import a function from a file via .. doxygenfunction:: cryptx_hazmat_powmod, if that function contains the restrict keyword, the XML output is <type>const uint8_t *restrict</type> which is incorrect.

This issue occurs only with .. doxygenfunction, not .. doxygenfile.

Min-reproducible code is zipped below. I usually build by running the local-build.sh script.
issue.zip

@michaeljones
Copy link
Collaborator

Thanks for the report and for the very well prepared example.

I'm not so involved these days but I poked around a bit. It seems like the function directive uses Sphinx C++ Domain code to parse the signature and 'restrict' isn't a keyword in C++ so it fails. I'm afraid I've not been in that part of the code for a long time and I'm not sure why it is being done like that. I imagine it is necessary to support overloaded functions in C++ by allowing users to specify the full function signature which then needs to be parsed but that is having a negative impact here.

Someone would have to look into using the C domain where appropriate (or no domain at all where appropriate) to handle this case better.

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

No branches or pull requests

2 participants