docsforge icon indicating copy to clipboard operation
docsforge copied to clipboard

Macros in code are causing parser errors.

Open biojppm opened this issue 5 years ago • 6 comments

In this file I use some macros to hide SFINAE ugliness. This then has a big impact in the generated documentation; for example, it says the code provides memcpy().

biojppm avatar Nov 18 '20 19:11 biojppm

tl;dr start with changing the configuration from MACRO_EXPANSION: 'NO' to MACRO_EXPANSION: 'YES'

Longer answer: docsforge uses Doxygen's output. There are multiple configuration options in doxygen to handle such cases. Please read doxygen preprocessor and the following comments from stackoverflow

docsforge has a current bug that makes your specific project a bit difficult to experiment with. It will be fixed and released in a few days, so I suggest you install doxygen and do a bit of testing with doxygen preprocessor commands in your local pc.

erez-o avatar Nov 19 '20 07:11 erez-o

Added a related feature request to my TODO list.

erez-o avatar Nov 19 '20 07:11 erez-o

Thanks for clarifying. I left some notes on #43 regarding how easy or hard it is to iterate the documentation. Otherwise, this is not a bug on Docsforge, so I'm closing. Thanks for the links; I'll try to find a way to work around this.

biojppm avatar Nov 21 '20 00:11 biojppm

The bug was fixed. You can iterate online without needing to install doxygen. Simply edit configurations parameters (like MACRO_EXPANSION) directly at https://c4core.docsforge.com/versions/ and rebuild docs until you're satisifed with the outcome. When you're satisfied, it's best you save the resulting configuration file in your repo.

erez-o avatar Nov 22 '20 18:11 erez-o

@erez-o Thanks for the notes.

I am wondering whether the Doxygen step is using its clang parser. I guess not. Would it be hard to setup? For template-heavy and macro-heavy code, the Doxygen parser is just dumb, and clang would solve a lot of headaches in the future. I'm reopening the bug as I'm really interested in fixing the documentation errors without having to remove macros.

biojppm avatar Nov 24 '20 16:11 biojppm

Currently it doesn't, it's not hard to setup, I can have it ready in a few days.

I would like to test it in my development setup. I haven't seen any doxygen cfg file for c4core. Can you please create a working cfg that uses doxygen's preprocessor and another that uses clang (with CLANG_ASSISTED_PARSING, CLANG_OPTIONS, CLANG_DATABASE_PATH values filled)?

erez-o avatar Nov 25 '20 06:11 erez-o