Summary: | devel/json-glib: Fix build with clang 11 | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Dimitry Andric <dim> | ||||
Component: | Individual Port(s) | Assignee: | Niclas Zeising <zeising> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | gnome, kbowling, zeising | ||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(gnome) |
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Dimitry Andric
2020-08-18 21:11:30 UTC
Sorry, the summary and description were not correct. In case of json-glib, it was a new clang 11 -Werror warning: ../json-glib/json-scanner.c:928:13: error: cast to smaller integer type 'GTokenType' from 'gpointer' (aka 'void *') [-Werror,-Wvoid-pointer-to-enum-cast] *token_p = (GTokenType) value_p->v_symbol; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is because v_symbol is a pointer and GTokenType is an enum (so int-like). Glib provides the GPOINTER_TO_INT macro for this purpose. Sorry, the summary and description were not correct. In case of json-glib, it was a new clang 11 -Werror warning: ../json-glib/json-scanner.c:928:13: error: cast to smaller integer type 'GTokenType' from 'gpointer' (aka 'void *') [-Werror,-Wvoid-pointer-to-enum-cast] *token_p = (GTokenType) value_p->v_symbol; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is because v_symbol is a pointer and GTokenType is an enum (so int-like). Glib provides the GPOINTER_TO_INT macro for this purpose. I've submitted upstream as https://gitlab.gnome.org/GNOME/json-glib/-/merge_requests/29 Committed, awaiting merge. A commit references this bug: Author: zeising Date: Sat Aug 22 09:37:47 UTC 2020 New revision: 545754 URL: https://svnweb.freebsd.org/changeset/ports/545754 Log: devel/json-glib: Fix build with llvm 11 Fix the build of devel/json-glib with llvm 11. llvm 11 introduced a new warning relating to how to cast between void * and enums, which json-glib are stumbling over. PR: 248736 Submitted by: dim MFH: 2020Q3 Changes: head/devel/json-glib/files/ head/devel/json-glib/files/patch-json-glib_json-scanner.c |