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

Can't compile on GCC 10.1 #1461

Open
priv-kweihmann opened this issue Jul 7, 2020 · 2 comments · May be fixed by #1462
Open

Can't compile on GCC 10.1 #1461

priv-kweihmann opened this issue Jul 7, 2020 · 2 comments · May be fixed by #1462

Comments

@priv-kweihmann
Copy link

priv-kweihmann commented Jul 7, 2020

building on gcc 10.1 with a reasonable warning set breaks the build.
Same code on gcc 9.x builds fine

| /work/src/http/common/http_helpers.cpp:91:43: error: '%8zX' directive output may be truncated writing between 8 and 16 bytes into a region of size 9 [-Werror=format-truncation=]
| 91 | snprintf(buffer, sizeof(buffer), "%8zX", bytes_read);
| | ^~~~
| /work/src/http/common/http_helpers.cpp:91:42: note: directive argument in the range [1, 18446744073709551615]
| 91 | snprintf(buffer, sizeof(buffer), "%8zX", bytes_read);
| | ^~~~~~
| In file included from /include/usr/include/stdio.h:867,
| from /include/usr/include/c++/10.1.0/cstdio:42,
| from /include/usr/include/c++/10.1.0/ext/string_conversions.h:43,
| from /include/usr/include/c++/10.1.0/bits/basic_string.h:6535,
| from /include/usr/include/c++/10.1.0/string:55,
| from /work/src/pch/stdafx.h:52,
| from /work/src/http/common/http_helpers.cpp:14:
| /include/usr/include/bits/stdio2.h:67:35: note: '__builtin___snprintf_chk' output between 9 and 17 bytes into a destination of size 9
| 67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 68 | __bos (__s), __fmt, __va_arg_pack ());
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| cc1plus: all warnings being treated as errors

@priv-kweihmann priv-kweihmann linked a pull request Jul 7, 2020 that will close this issue
@Hyask
Copy link

Hyask commented Feb 17, 2021

Any news on this issue? The pull request worked fine for me too. Could it me merged?

@Alexander-Degtyar
Copy link

Alexander-Degtyar commented Feb 18, 2021

The pull request worked fine for me too.

For me too. All autotests passed.
gcc 10.2.0
Arch Linux 5.10.16-arch1-1

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

Successfully merging a pull request may close this issue.

3 participants