This is an archive of the discontinued LLVM Phabricator instance.

[clang/docs] Fix various sphinx warnings/errors in docs.
ClosedPublic

Authored by fhahn on Mar 20 2020, 3:25 PM.

Details

Summary

There are a few places with unexpected indents that trip over sphinx and
other syntax errors.

Also, the C++ syntax highlighting does not work for

class [[gsl::Owner(int)]] IntOwner {

Use a regular code:: block instead.

There are a few other warnings errors remaining, of the form
'Duplicate explicit target name: "cmdoption-clang--prefix"'. They seem
to be caused by the following

.. option:: -B<dir>, --prefix <arg>, --prefix=<arg>

I am no Restructured Text expert, but it seems like sphinx 1.8.5
tries to generate the same target for the --prefix <arg> and
--prefix=<arg>. This pops up in a lot of places and I am not sure how to
best resolve it

Diff Detail

Event Timeline

fhahn created this revision.Mar 20 2020, 3:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2020, 3:25 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rjmccall accepted this revision.Mar 20 2020, 8:13 PM
rjmccall added a subscriber: rjmccall.

Is the option issue causing the documentation to be wrong in any way, or does it just produce a warning? If the latter, we could raise this issue with them.

This revision is now accepted and ready to land.Mar 20 2020, 8:13 PM
This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Mar 23 2020, 8:05 AM

Is the option issue causing the documentation to be wrong in any way, or does it just produce a warning? If the latter, we could raise this issue with them.

I think it just produces a warning, it looks like sphinx still creates unique labels, e.g. https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-flto for -flto and https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang1-flto for -flto=. But LLVM/Clang defaults to SPHINX_WARNINGS_AS_ERRORS=ON and there are quite a few instances of this warning.

Sure. I'm not asking you to fix this, I'm just asking your opinion about the right thing to do. Is the Sphinx warning reasonable, such that we should fix our (autogenerated, IIRC) input to avoid the "redundant" spellings, or should we ask Sphinx to handle it more gracefully in the future?