Skip to content
Snippets Groups Projects
  • Peter Maydell's avatar
    36420664
    docs/sphinx/kerneldoc.py: Honour --enable-werror · 36420664
    Peter Maydell authored
    Currently, the kerneldoc Sphinx plugin doesn't honour the
    --enable-werror configure option, so its warnings are never fatal.
    This is because although we do pass sphinx-build the -W switch, the
    warnings from kerneldoc are produced by the scripts/kernel-doc script
    directly and don't go through Sphinx's "emit a warning" function.
    
    When --enable-werror is in effect, pass sphinx-build an extra
    argument -Dkerneldoc_werror=1.  The kerneldoc plugin can then use
    this to determine whether it should be passing the kernel-doc script
    -Werror.
    
    We do this because there is no documented mechanism for
    a Sphinx plugin to determine whether sphinx-build was
    passed -W or not; if one is provided then we can switch to
    that at a later date:
    https://github.com/sphinx-doc/sphinx/issues/11239
    
    
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
    Message-Id: <20230314114431.1096972-1-peter.maydell@linaro.org>
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
    36420664
    History
    docs/sphinx/kerneldoc.py: Honour --enable-werror
    Peter Maydell authored
    Currently, the kerneldoc Sphinx plugin doesn't honour the
    --enable-werror configure option, so its warnings are never fatal.
    This is because although we do pass sphinx-build the -W switch, the
    warnings from kerneldoc are produced by the scripts/kernel-doc script
    directly and don't go through Sphinx's "emit a warning" function.
    
    When --enable-werror is in effect, pass sphinx-build an extra
    argument -Dkerneldoc_werror=1.  The kerneldoc plugin can then use
    this to determine whether it should be passing the kernel-doc script
    -Werror.
    
    We do this because there is no documented mechanism for
    a Sphinx plugin to determine whether sphinx-build was
    passed -W or not; if one is provided then we can switch to
    that at a later date:
    https://github.com/sphinx-doc/sphinx/issues/11239
    
    
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
    Message-Id: <20230314114431.1096972-1-peter.maydell@linaro.org>
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>