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

"Writing 2 bytes into a region of size 0" warning on GCC10 #2120

Closed
OptoCloud opened this issue Jan 28, 2021 · 4 comments
Closed

"Writing 2 bytes into a region of size 0" warning on GCC10 #2120

OptoCloud opened this issue Jan 28, 2021 · 4 comments

Comments

@OptoCloud
Copy link
Contributor

OptoCloud commented Jan 28, 2021

This is the entire error message, so im guessing its something internally in fmt, and not my application

In function ‘memcpy’,
    inlined from ‘format_decimal’ at /home/OptoCloud/Documents/GitHub/MyApp/libs/fmt/include/fmt/format.h:1093:59,
    inlined from ‘format_decimal’ at /home/OptoCloud/Documents/GitHub/MyApp/libs/fmt/include/fmt/format.h:1141:28,
    inlined from ‘write’ at /home/OptoCloud/Documents/GitHub/MyApp/libs/fmt/include/fmt/format.h:2145:28:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:33: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=]
   34 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
      |                                 ^
/home/OptoCloud/Documents/GitHub/MyApp/libs/fmt/include/fmt/format.h: In function ‘write’:
/home/OptoCloud/Documents/GitHub/MyApp/libs/fmt/include/fmt/format.h:1140:8: note: at offset -2 to object ‘buffer’ with size 10 declared here
 1140 |   Char buffer[digits10<UInt>() + 1];
      |        ^
@vitaut
Copy link
Contributor

vitaut commented Jan 28, 2021

Please provide a repro.

@OnurKader
Copy link

Could this be related to #1810?

@OptoCloud
Copy link
Contributor Author

Yup #1810 (comment)

@vitaut
Copy link
Contributor

vitaut commented Jan 29, 2021

Closing then. If this is a different issue feel free to reopen with the code to reproduce and version information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants