-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build warnings of [-Wsingle-bit-bitfield-constant-conversion] from outdated GraphViz library #80
Comments
I am also having the same bug on latest master and latest tagged. clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
go install github.com/goccy/go-graphviz/cmd/dot@master
go: downloading github.com/goccy/go-graphviz v0.1.3-0.20240305010347-606fdf55b06d
# github.com/goccy/go-graphviz/internal/ccall
In file included from common.c:5:
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:165:35: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2540:24: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2596:35: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2602:35: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2612:31: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2623:31: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2628:31: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2641:28: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2650:33: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2659:32: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2668:32: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
go install github.com/goccy/go-graphviz/cmd/[email protected]
# github.com/goccy/go-graphviz/internal/ccall
In file included from common.c:5:
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:165:35: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2540:24: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2596:35: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2602:35: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2612:31: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2623:31: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2628:31: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2641:28: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2650:33: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2659:32: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
../../../../../../../../pkg/mod/github.com/goccy/[email protected]/internal/ccall/common/emit.c:2668:32: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment details
Go version
C Compiler
Issue
When building the example code in the repository's readme with
go build
, I see the following compiler warnings fromclang
:Note that this is a separate issue from #72 and is not fixed by #77.
These come from the bundled GraphViz library assigning a literal
1
to signed int bitfields of anobj_state_t
. This issue was resolved in GraphViz 3.0.0 released on 2022-02-26. The specific commit with the fix is 96f9d101, which simply changes the relevant bitfields to unsigned ints. These bitfields are present in go-graphviz here:go-graphviz/internal/ccall/gvc/gvcjob.h
Lines 235 to 244 in 9f8e121
This issue can be resolved extremely easily by replacing the
int
keyword withunsigned
(alias forunsigned int
) in the above code, just as the GraphViz developers did. However, I would like to push for #42 to be finished and the bundled libraries (including GraphViz and Expat) to be updated to more recent versions. Updating the bundled dependencies would close out several other issues in this repository, like #47. More pressingly, bundling outdated libraries poses a security risk, as evidenced by the Expat CVEs mentioned in #76.Please let me know if you would like me to submit a PR for the specific issue of the bitfield warnings. In the meantime, can you provide a timeline on when the bundled libraries might be able to be updated? Thank you.
The text was updated successfully, but these errors were encountered: