public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "unlvsur at live dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102466] New: -O3 -fsanitize=undefined causes warnings (writing 2 bytes into a region of size 0) Date: Thu, 23 Sep 2021 07:08:27 +0000 [thread overview] Message-ID: <bug-102466-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102466 Bug ID: 102466 Summary: -O3 -fsanitize=undefined causes warnings (writing 2 bytes into a region of size 0) Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: unlvsur at live dot com Target Milestone: --- Created attachment 51503 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51503&action=edit Preprocessed file without -fsanitize=undefined or use -O2 won't trigger the warning here cqwrteur@Home-Server:~/fast_io/examples/0021.kernel_driver$ g++ -S main.cc -std=c++20 -I../../include -s -fno-exceptions -fno-rtti -fsanitize=undefined -O3 -ffreestanding In function 'constexpr void fast_io::linux::print_status_define(fast_io::linux::basic_kpr<ch_type>, Args ...) [with bool line = true; ch_type = char; Args = {fast_io::basic_io_scatter_t<char>, fast_io::manipulators::scalar_manip_t<fast_io::manipulators::scalar_flags{10, false, false, false, false, false, false, false, true, false, false, false, fast_io::manipulators::scalar_placement::none, fast_io::manipulators::floating_format::fixed, fast_io::manipulators::lc_time_flag::none}, int>, fast_io::basic_io_scatter_t<char>, fast_io::basic_io_scatter_t<char>, fast_io::manipulators::scalar_manip_t<fast_io::manipulators::scalar_flags{10, false, false, false, false, false, false, false, true, false, false, false, fast_io::manipulators::scalar_placement::none, fast_io::manipulators::floating_format::fixed, fast_io::manipulators::lc_time_flag::none}, int>, fast_io::manipulators::scalar_manip_t<fast_io::manipulators::scalar_flags{10, false, false, false, false, false, false, false, true, false, false, false, fast_io::manipulators::scalar_placement::none, fast_io::manipulators::floating_format::fixed, fast_io::manipulators::lc_time_flag::none}, unsigned int>}]': cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] cc1plus: warning: writing 2 bytes into a region of size 0 [-Wstringop-overflow=] This is freestanding code to reduce size of processor file. You can just treat printk function as printf. -ffreestanding does not affect whether the warning would emit or not. Do not know whether it is a false positive.
next reply other threads:[~2021-09-23 7:08 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-23 7:08 unlvsur at live dot com [this message] 2021-09-27 14:00 ` [Bug tree-optimization/102466] " marxin at gcc dot gnu.org 2021-09-27 21:37 ` msebor at gcc dot gnu.org 2022-03-29 14:20 ` mathieu.malaterre at gmail dot com 2022-03-29 14:22 ` mathieu.malaterre at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-102466-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).