Bug 282164 - audio/oss: fix build with clang 19
Summary: audio/oss: fix build with clang 19
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks: 280562
  Show dependency treegraph
 
Reported: 2024-10-17 19:18 UTC by Dimitry Andric
Modified: 2024-10-17 19:33 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (crees)


Attachments
audio/oss: fix build with clang 19 (1.55 KB, patch)
2024-10-17 19:22 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-10-17 19:18:24 UTC
Clang 19 has become more strict about erroneous redeclarations, which
results in an error building audio/oss:

  oss_sndstat.c:114:17: error: redeclaration of 'version' with a different type: 'char[]' vs 'const char[]'
    114 |     extern char version[];
        |                 ^
  /usr/include/sys/systm.h:54:19: note: previous declaration is here
     54 | extern const char version[];    /* system version */
        |                   ^

Since version[] has been a const char for quite a while now, adjust the
redeclaration in oss_sndstat.c. Note that it also might be deleted
entirely, since the file already includes <sys/systm.h>.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-10-17 19:22:27 UTC
Created attachment 254314 [details]
audio/oss: fix build with clang 19
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-10-17 19:32:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=38dbaaa03aa58861e78dafb674e3e2ed5b7eda7c

commit 38dbaaa03aa58861e78dafb674e3e2ed5b7eda7c
Author:     Chris Rees <crees@FreeBSD.org>
AuthorDate: 2024-10-17 19:29:33 +0000
Commit:     Chris Rees <crees@FreeBSD.org>
CommitDate: 2024-10-17 19:31:52 +0000

    audio/oss: Build fix for clang 19

    PR:             ports/282164
    Thanks to:      dim

 ...h-kernel_framework_sndstat_oss__sndstat.c (new) | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
Comment 3 Chris Rees freebsd_committer freebsd_triage 2024-10-17 19:33:42 UTC
Brilliant, thanks a lot!