Skip to content

Conversation

@trilkk
Copy link

@trilkk trilkk commented Jan 28, 2026

Description

Fix compilation errors on clang 19.1.7 on FreeBSD 15.0-RELEASE.

Motivation and Context

Apparently the current clang version on FreeBSD considers some earlier warnings as errors.
Additionally libprocstat.h requires several sys/ headers to be included prior to including it.

How Has This Been Tested?

The program has been compiled and starts on my local machine with FreeBSD 15.0-RELEASE-p1.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@mihawk90
Copy link
Contributor

Needs commit prefixes, see the contributing document

@trilkk trilkk force-pushed the freebsd-15-compilation-fix-2026-01-28 branch from 5293439 to e9a1d1e Compare January 28, 2026 21:51
@trilkk
Copy link
Author

trilkk commented Jan 28, 2026

Needs commit prefixes, see the contributing document

An attempt has been made. Force pushed.

@PatTheMav
Copy link
Member

Commit prefixes don't need to use the entire path, so for any plugin-related change the prefix plugins is sufficient (I'm working on an update to the contribution guidelines that make this more explicit).

Copy link
Member

@PatTheMav PatTheMav left a comment

Choose a reason for hiding this comment

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

Can you provide the compiler error messages that lead you to make these changes?

I wonder specifically about the curl-related changes, whether they are indeed due to clang being more strict about narrowing of types or if this is due to more recent curl versions being more strict about the type correctness of curl_easy_setopt.

@trilkk trilkk force-pushed the freebsd-15-compilation-fix-2026-01-28 branch from e9a1d1e to fb35367 Compare January 30, 2026 18:00
@trilkk
Copy link
Author

trilkk commented Jan 30, 2026

Another attempt was made.

There are quite a lot of errors:

[ 27%] Building C object plugins/linux-v4l2/CMakeFiles/linux-v4l2.dir/v4l2-helpers.c.o
/usr/local/src/obs-studio/plugins/linux-v4l2/v4l2-helpers.c:80:68: error: format specifies type 'long' but the argument has type 'uint_fast32_t' (aka 'unsigned int') [-Werror,-Wformat]
   80 |         blog(LOG_DEBUG, "attempting to read buffer data for %ld buffers", buf_data->count);
      |                                                             ~~~           ^~~~~~~~~~~~~~~
      |                                                             %u
...
/usr/local/src/obs-studio/plugins/linux-v4l2/v4l2-helpers.c:87:66: error: format specifies type 'long' but the argument has type 'uint_fast32_t' (aka 'unsigned int') [-Werror,-Wformat]
   87 |                         blog(LOG_DEBUG, "failed to read buffer data for buffer #%ld", i);
      |                                                                                 ~~~   ^
      |                                                                                 %u
...
/usr/local/src/obs-studio/plugins/linux-v4l2/v4l2-helpers.c:90:94: error: format specifies type 'long' but the argument has type 'uint_fast32_t' (aka 'unsigned int') [-Werror,-Wformat]
   90 |                              "query buf #%ld info: ts: %06ld buf id #%d, flags 0x%08X, seq #%d, len %d, used %d", i,
      |                                          ~~~                                                                      ^
      |                                          %u
...
/usr/local/src/obs-studio/shared/file-updater/file-updater/file-updater.c:114:2: error: call to 'Wcurl_easy_setopt_err_long' declared with 'warning' attribute: curl_easy_setopt expects a long argument [-Werror,-Wattribute-warning]
  114 |         curl_easy_setopt(info->curl, CURLOPT_NOSIGNAL, 1);
      |         ^
...
/usr/local/src/obs-studio/shared/file-updater/file-updater/file-updater.c:113:2: error: call to 'Wcurl_easy_setopt_err_long' declared with 'warning' attribute: curl_easy_setopt expects a long argument [-Werror,-Wattribute-warning]
  113 |         curl_easy_setopt(info->curl, CURLOPT_FAILONERROR, true);
      |         ^
...
/usr/local/src/obs-studio/shared/file-updater/file-updater/file-updater.c:111:2: error: call to 'Wcurl_easy_setopt_err_write_callback' declared with 'warning' attribute: curl_easy_setopt expects a curl_write_callback argument [-Werror,-Wattribute-warning]
  111 |         curl_easy_setopt(info->curl, CURLOPT_WRITEFUNCTION, http_write);
      |         ^
...
/usr/local/src/obs-studio/shared/file-updater/file-updater/file-updater.c:120:3: error: call to 'Wcurl_easy_setopt_err_write_callback' declared with 'warning' attribute: curl_easy_setopt expects a curl_write_callback argument [-Werror,-Wattribute-warning]
  120 |                 curl_easy_setopt(info->curl, CURLOPT_HEADERFUNCTION, http_header);
      |                 ^
...
usr/local/src/obs-studio/plugins/rtmp-services/service-specific/nimotv.c:87:2: error: call to 'Wcurl_easy_setopt_err_long' declared with 'warning' attribute: curl_easy_setopt expects a long argument [-Werror,-Wattribute-warning]
   87 |         curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, true);
      |         ^
...
/usr/local/src/obs-studio/plugins/rtmp-services/service-specific/showroom.c:116:2: error: call to 'Wcurl_easy_setopt_err_long' declared with 'warning' attribute: curl_easy_setopt expects a long argument [-Werror,-Wattribute-warning]
  116 |         curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, true);
      |         ^
...
In file included from /usr/local/src/obs-studio/frontend/utility/platform-x11.cpp:43:
/usr/include/libprocstat.h:128:2: error: unknown type name 'STAILQ_ENTRY'
  128 |         STAILQ_ENTRY(filestat)  next;
      |         ^
/usr/include/libprocstat.h:128:24: error: expected ';' at end of declaration list
  128 |         STAILQ_ENTRY(filestat)  next;
      |                               ^
/usr/include/libprocstat.h:139:19: error: use of undeclared identifier 'SPECNAMELEN'
  139 |         char            vn_devname[SPECNAMELEN + 1];
      |                                    ^
/usr/include/libprocstat.h:143:16: error: use of undeclared identifier 'SPECNAMELEN'
  143 |         char            devname[SPECNAMELEN + 1];
      |                                 ^
/usr/include/libprocstat.h:166:26: error: field has incomplete type 'struct sockaddr_storage'
  166 |         struct sockaddr_storage sa_local;       /* Socket address. */
      |                                 ^
/usr/include/libprocstat.h:166:9: note: forward declaration of 'sockaddr_storage'
  166 |         struct sockaddr_storage sa_local;       /* Socket address. */
      |                ^
/usr/include/libprocstat.h:167:26: error: field has incomplete type 'struct sockaddr_storage'
  167 |         struct sockaddr_storage sa_peer;        /* Peer address. */
      |                                 ^
/usr/include/libprocstat.h:166:9: note: forward declaration of 'sockaddr_storage'
  166 |         struct sockaddr_storage sa_local;       /* Socket address. */
      |                ^
/usr/include/libprocstat.h:174:13: error: unknown type name 'filestat_list'
  174 | STAILQ_HEAD(filestat_list, filestat);
      |             ^
/usr/include/libprocstat.h:174:1: error: a type specifier is required for all declarations
  174 | STAILQ_HEAD(filestat_list, filestat);
      | ^
/usr/include/libprocstat.h:187:2: error: unknown type name 'STAILQ_ENTRY'
  187 |         STAILQ_ENTRY(advlock)   next;
      |         ^
/usr/include/libprocstat.h:187:23: error: expected ';' at end of declaration list
  187 |         STAILQ_ENTRY(advlock)   next;
      |                              ^
/usr/include/libprocstat.h:197:13: error: unknown type name 'advlock_list'
  197 | STAILQ_HEAD(advlock_list, advlock);
      |             ^
/usr/include/libprocstat.h:197:1: error: a type specifier is required for all declarations
  197 | STAILQ_HEAD(advlock_list, advlock);
      | ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants