Skip to content
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

warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] #205

Open
andig opened this issue Feb 8, 2025 · 5 comments

Comments

@andig
Copy link

andig commented Feb 8, 2025

On

Darwin MAC-A25058-FVFF634UQ05N 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:06 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8103 arm64
❯ go install github.com/ofabry/go-callvis@master
go: downloading github.com/ofabry/go-callvis v0.7.2-0.20250102153122-fb6b442a4144
go: downloading github.com/goccy/go-graphviz v0.1.2
go: downloading golang.org/x/image v0.18.0
# github.com/goccy/go-graphviz/internal/ccall
In file included from common.c:5:
./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]
@ondrej-fabry
Copy link
Collaborator

ondrej-fabry commented Feb 8, 2025

Hello, thanks for reporting.
It's a warning, it should be ok. Are you experiencing some issues with rendering?

@andig
Copy link
Author

andig commented Feb 8, 2025

Just getting started- no actual issue.

@akram-suplari
Copy link

I am having the same issue (uname Darwin 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:50:00 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6031 arm64 arm) but the installation is not performed so I cannot run it.

I also tried cloning and doing make install and same issue shows up and no binary is installed.

make test does not work either:

make test                                                                                                                                                                      
go test -tags "" -ldflags "-X main.commit=v0.7.1-4-gfb6b442 -w -s" -trimpath -short -race ./...
# github.com/goccy/go-graphviz/internal/ccall
In file included from common.c:5:
./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]
./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]
./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]
./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]
./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]
./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]
./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]
./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]
./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]
./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]
./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]
?   	github.com/ofabry/go-callvis	[no test files]
?   	github.com/ofabry/go-callvis/examples/main/mypkg	[no test files]
?   	github.com/ofabry/go-callvis/examples/main	[no test files]

Anything else I can provide to debug this issue?

@ondrej-fabry
Copy link
Collaborator

@akram-suplari hey, try compiling without CGO enabled

@akram-suplari
Copy link

Yes, that worked!

Thanks

For reference:

build:  ## Build go-callvis
	CGO_ENABLED=0 go build -v -tags $(GO_BUILD_TAGS) -ldflags "$(GO_LDFLAGS)" $(GO_BUILD_ARGS)

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

No branches or pull requests

3 participants