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

Error in declarator or parameters #500

Closed
StrikerRUS opened this issue Apr 10, 2020 · 5 comments
Closed

Error in declarator or parameters #500

StrikerRUS opened this issue Apr 10, 2020 · 5 comments
Assignees
Labels
upstream Issue in external software

Comments

@StrikerRUS
Copy link
Contributor

StrikerRUS commented Apr 10, 2020

Now that sphinx-doc/sphinx#7423 is merged and Sphinx 3.0.1 is released, we can say that breathe 4.15.0 has a regression problem with some function definitions which worked well before.

Repro can be taken from my comment in Sphinx repo: sphinx-doc/sphinx#7423 (comment).

The problem is in the following functions.

LIGHTGBM_C_EXPORT int LGBM_BoosterFree(int handle);
Warning, treated as error:
/home/travis/build/microsoft/LightGBM/docs/C-API.rst:4:Error in declarator or parameters
Invalid C declaration: Expected identifier in nested name, got keyword: int [error at 21]
  LIGHTGBM_C_EXPORT int LGBM_BoosterAddValidData(BoosterHandle handle, const  DatasetHandle valid_data)
  ---------------------^
Makefile:20: recipe for target 'html' failed

Or is it a bug at Sphinx side?

@jakobandersen
Copy link
Collaborator

This is something that should be enhanced on the Sphinx side. The problem is that it is not a valid function declaration, though I guess LIGHTGBM_C_EXPORT expands to an an attribute for symbol visibility? I have opened an issue to track the feature.

@StrikerRUS
Copy link
Contributor Author

@jakobandersen Thank you very much for that prompt response!

Here is the LIGHTGBM_C_EXPORT definition: https://github.com/microsoft/LightGBM/blob/master/include/LightGBM/export.h

@jakobandersen
Copy link
Collaborator

This should be fixed in Sphinx 3.0.2 once it is released (you can try with the 3.0.x branch). You will need to put

c_id_attributes = ['LIGHTGBM_C_EXPORT']

in conf.py to tell the parser to recognize the custom attribute.

@StrikerRUS
Copy link
Contributor Author

Thanks a lot for the prompt fix! I'll try it on RTD site right after the 3.0.2 release.

@StrikerRUS
Copy link
Contributor Author

@jakobandersen Everything works fine with Sphinx 3.0.2! Thank you very much for the awesome support!

@vermeeren vermeeren self-assigned this Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Issue in external software
Projects
None yet
Development

No branches or pull requests

3 participants