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: ‘Z’ directive writing 1 byte into a region of size between 0 and 9 [-Wformat-overflow= #14

Closed
rfikki opened this issue Mar 13, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@rfikki
Copy link

rfikki commented Mar 13, 2020

Describe the bug
github.com/ava-labs/go-ethereum/accounts/usbwallet/trezor
github.com/ava-labs/go-ethereum/p2p

github.com/ava-labs/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3

duk_logging.c: In function ‘duk__logger_prototype_log_shared’:
duk_logging.c:184:64: warning: ‘Z’ directive writing 1 byte into a region of size between 0 and 9 [-Wformat-overflow=]
sprintf((char *) date_buf, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",
^
In file included from /usr/include/stdio.h:862,
from duk_logging.c:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 25 and 85 bytes into a destination of size 32
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To Reproduce
Steps to reproduce the behavior.

Expected behavior
no error

Operating System
WSL - Ubuntu 18.04

By submitting this issue I agree to the Terms and Conditions of the Developer Accelerator Program.

@rfikki rfikki added the bug Something isn't working label Mar 13, 2020
@swdee
Copy link
Contributor

swdee commented Mar 14, 2020

The upstream bug report for this is here svaarala/duktape#2137

@moreati
Copy link
Contributor

moreati commented Mar 27, 2020

I think the bug is actually in the Go bindings for duktape: https://github.com/olebedev/go-duktape, specifically fixed by olebedev/go-duktape#67, and ethereum/go-ethereum#20777. Awaiting approval or feedback on ava-labs/libevm#1 to incorporate the fix into Avalab's vendored version

@StephenButtolph
Copy link
Contributor

ava-labs/go-ethereum#1 was merged, there are still warning relating to the duktape repo, but the overflow warning has been fixed.

@moreati
Copy link
Contributor

moreati commented Mar 31, 2020

For the record, the remaining warning I see is

# github.com/ava-labs/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3
In file included from _cgo_export.c:4:
debugger.go:22:13: warning: ‘_duk_debugger_attach’ defined but not used [-Wunused-function]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants