Skip to content

Commit

Permalink
Some of the X headers on OSX are apparently causing -Wdocumentation w…
Browse files Browse the repository at this point in the history
…arnings...
  • Loading branch information
starseeker committed Sep 25, 2024
1 parent 00364f2 commit fddaf4d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libdm/X/color.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@
#include <stdio.h>
#include <string.h>

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdocumentation"
#endif
#ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h>
#endif
#if defined(__clang__)
# pragma clang diagnostic pop
#endif

#include "vmath.h"

#include "bu/malloc.h"
Expand Down
9 changes: 9 additions & 0 deletions src/libdm/X/dm-X.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
#include <string.h>
#include <math.h>

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdocumentation"
#endif

#define class REDEFINE_CLASS_STRING_TO_AVOID_CXX_CONFLICT
#include <X11/Xlib.h>
#include <X11/Xutil.h>
Expand All @@ -44,6 +49,10 @@
# include <X11/extensions/XInput.h>
#endif /* HAVE_X11_XINPUT_H */

#if defined(__clang__)
# pragma clang diagnostic pop
#endif

#if defined(linux)
# undef X_NOT_STDC_ENV
# undef X_NOT_POSIX
Expand Down
7 changes: 7 additions & 0 deletions src/libdm/X/dm-X.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@

#include "common.h"

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdocumentation"
#endif
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#if defined(__clang__)
# pragma clang diagnostic pop
#endif

#include "tk.h"
#define HAVE_X11_TYPES 1
Expand Down
8 changes: 8 additions & 0 deletions src/libdm/X/fb_X.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@

#ifdef FB_USE_INTERNAL_API
#include "common.h"

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdocumentation"
#endif
#include <X11/X.h>
#if defined(__clang__)
# pragma clang diagnostic pop
#endif

struct X24_fb_info {
Display *dpy;
Expand Down
7 changes: 7 additions & 0 deletions src/libdm/X/if_X24.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
# endif
#endif

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdocumentation"
#endif
#include <X11/X.h>
#ifdef HAVE_XOSDEFS_H
# include <X11/Xfuncproto.h>
Expand All @@ -65,6 +69,9 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#if defined(__clang__)
# pragma clang diagnostic pop
#endif

#include <ctype.h>

Expand Down

2 comments on commit fddaf4d

@brlcad
Copy link
Member

@brlcad brlcad commented on fddaf4d Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed? When the headers are pulled from directories tagged as SYSTEM, the warnings are correctly suppressed. Did something change where it's finding some non-system includes or are there system includes not being tagged correctly?

@starseeker
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some Github CI testing on Mac I was seeing those crop up, I think from homebrew paths? I wasn't using Ninja to build (unlike our standard CI tests) so it may be something to do with the default build tool used on OSX...

Please sign in to comment.