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

20210715.151551.e7ad03a: -Wstringop-overflow compile time warnings #36

Open
kloczek opened this issue Jul 16, 2021 · 0 comments
Open

20210715.151551.e7ad03a: -Wstringop-overflow compile time warnings #36

kloczek opened this issue Jul 16, 2021 · 0 comments

Comments

@kloczek
Copy link

kloczek commented Jul 16, 2021

gcc 11.1.1

/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/main.cpp: In function 'int real_main(int, char**)':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/main.cpp:3800:26: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
 3800 |             sizeof(char) * set_UTF16_text
      |             ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/parsley.cpp: In function 'void APar_freefree(int)':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/parsley.cpp:2188:9: warning: variable 'prev_atom' set but not used [-Wunused-but-set-variable]
 2188 |   short prev_atom = 0;
      |         ^~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/parsley.cpp: In function 'uint64_t APar_QuickSumAtomicLengths(AtomicInfo*)':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/parsley.cpp:4041:9: warning: variable 'current_level' set but not used [-Wunused-but-set-variable]
 4041 |   short current_level = 0;
      |         ^~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/parsley.cpp: In function 'bool APar_Readjust_iloc_atom(short int)':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/parsley.cpp:4188:18: warning: variable 'this_extent_offset' set but not used [-Wunused-but-set-variable]
 4188 |         uint64_t this_extent_offset = 0;
      |                  ^~~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/parsley.cpp: In function 'void APar_DetermineAtomLengths()':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/parsley.cpp:5186:11: warning: variable 'previous_atom' set but not used [-Wunused-but-set-variable]
 5186 |     short previous_atom = 0; // only gets used in testing for atom under stsd
      |           ^~~~~~~~~~~~~
In function 'APar_UnpackLanguage',
    inlined from 'APar_Print_single_userdata_atomcontents' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1158:24:
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/util.cpp:394:16: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  394 |   lang_code[3] = 0;
      |                ^
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp: In function 'APar_Print_single_userdata_atomcontents':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:981:17: note: at offset 3 into destination object 'unpacked_lang' of size 3
  981 |   unsigned char unpacked_lang[3];
      |                 ^
In function 'APar_UnpackLanguage',
    inlined from 'APar_Print_single_userdata_atomcontents' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1058:24:
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/util.cpp:394:16: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  394 |   lang_code[3] = 0;
      |                ^
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp: In function 'APar_Print_single_userdata_atomcontents':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:981:17: note: at offset 3 into destination object 'unpacked_lang' of size 3
  981 |   unsigned char unpacked_lang[3];
      |                 ^
In function 'APar_UnpackLanguage',
    inlined from 'APar_Print_single_userdata_atomcontents' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1110:24:
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/util.cpp:394:16: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  394 |   lang_code[3] = 0;
      |                ^
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp: In function 'APar_Print_single_userdata_atomcontents':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:981:17: note: at offset 3 into destination object 'unpacked_lang' of size 3
  981 |   unsigned char unpacked_lang[3];
      |                 ^
In function 'APar_UnpackLanguage',
    inlined from 'APar_Print_single_userdata_atomcontents' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1090:24:
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/util.cpp:394:16: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  394 |   lang_code[3] = 0;
      |                ^
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp: In function 'APar_Print_single_userdata_atomcontents':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:981:17: note: at offset 3 into destination object 'unpacked_lang' of size 3
  981 |   unsigned char unpacked_lang[3];
      |                 ^
In function 'APar_UnpackLanguage',
    inlined from 'APar_Print_single_userdata_atomcontents' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1002:24:
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/util.cpp:394:16: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  394 |   lang_code[3] = 0;
      |                ^
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp: In function 'APar_Print_single_userdata_atomcontents':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:981:17: note: at offset 3 into destination object 'unpacked_lang' of size 3
  981 |   unsigned char unpacked_lang[3];
      |                 ^
In function 'APar_UnpackLanguage',
    inlined from 'APar_Print_ID3v2_tags' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1412:22,
    inlined from 'APar_Print_metachild_atomcontents' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1760:26,
    inlined from '_Z22APar_PrintMetaChildrenP10AtomicInfoS0_b.part.0.isra' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1774:44:
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/util.cpp:394:16: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  394 |   lang_code[3] = 0;
      |                ^
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp: In function '_Z22APar_PrintMetaChildrenP10AtomicInfoS0_b.part.0.isra':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:1411:17: note: at offset 3 into destination object 'unpacked_lang' of size 3
 1411 |   unsigned char unpacked_lang[3];
      |                 ^
In function 'APar_UnpackLanguage',
    inlined from 'APar_PrintAtomicTree' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:2015:26,
    inlined from 'real_main' at /home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/main.cpp:1631:27:
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/util.cpp:394:16: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  394 |   lang_code[3] = 0;
      |                ^
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/main.cpp: In function 'real_main':
/home/tkloczko/rpmbuild/BUILD/atomicparsley-20210715.151551.e7ad03a/src/metalist.cpp:2014:21: note: at offset 3 into destination object 'unpacked_lang' of size 3
 2014 |       unsigned char unpacked_lang[3];
      |                     ^
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

1 participant