Skip to content

New Build warnings following latest changes #426

@philippedistributive

Description

@philippedistributive

Issue type

Bug

How did you install PythonMonkey?

None

OS platform and distribution

No response

Python version (python --version)

No response

PythonMonkey version (pip show pythonmonkey)

No response

Bug Description

Regression introduced by #417: build warnings

/home/philippe/Sources/PythonMonkey/src/PyBytesProxyHandler.cc: In function ‘bool array_valueOf(JSContext*, unsigned int, JS::Value*)’:
/home/philippe/Sources/PythonMonkey/src/PyBytesProxyHandler.cc:46:44: warning: ‘%d’ directive output truncated writing between 1 and 3 bytes into a region of size 0 [-Wformat-truncation=]
46 | snprintf((char )&buffer[charIndex], 4, "%d", data[0]);
| ^~
/home/philippe/Sources/PythonMonkey/src/PyBytesProxyHandler.cc:46:43: note: directive argument in the range [0, 255]
46 | snprintf((char )&buffer[charIndex], 4, "%d", data[0]);
| ^~~~
In file included from /usr/include/stdio.h:980,
from /home/philippe/Sources/PythonMonkey/_spidermonkey_install/include/mozjs-130a1/mozilla/Assertions.h:68,
from /home/philippe/Sources/PythonMonkey/_spidermonkey_install/include/mozjs-130a1/mozilla/AlreadyAddRefed.h:14,
from /home/philippe/Sources/PythonMonkey/_spidermonkey_install/include/mozjs-130a1/jsapi.h:12,
from /home/philippe/Sources/PythonMonkey/include/PyBaseProxyHandler.hh:14,
from /home/philippe/Sources/PythonMonkey/include/PyObjectProxyHandler.hh:14,
from /home/philippe/Sources/PythonMonkey/include/PyBytesProxyHandler.hh:15,
from /home/philippe/Sources/PythonMonkey/src/PyBytesProxyHandler.cc:12:
In function ‘int snprintf(char
, size_t, const char
, ...)’,
inlined from ‘bool array_valueOf(JSContext*, unsigned int, JS::Value*)’ at /home/philippe/Sources/PythonMonkey/src/PyBytesProxyHandler.cc:46:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:54:35: note: ‘__builtin___snprintf_chk’ output between 2 and 4 bytes into a destination of size 0
54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~

Standalone code to reproduce the issue

No response

Relevant log output or backtrace

No response

Additional info if applicable

No response

What branch of PythonMonkey were you developing on? (If applicable)

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions