public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format
@ 2020-10-29  0:22 euloanty at live dot com
  2020-10-29  8:47 ` [Bug bootstrap/97622] " jakub at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: euloanty at live dot com @ 2020-10-29  0:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

            Bug ID: 97622
           Summary: ubsan '  unterminated quote character ''' in format
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: euloanty at live dot com
  Target Milestone: ---

'%s%s%s. no. it should be \'%s%s%s%s%s%s%s???

      pp_printf (&pretty_name, "'%s%s%s%s%s%s%s",
                 TYPE_VOLATILE (type2) ? "volatile " : "",
                 TYPE_READONLY (type2) ? "const " : "",
                 TYPE_RESTRICT (type2) ? "restrict " : "",
                 TYPE_ATOMIC (type2) ? "_Atomic " : "",
                 TREE_CODE (type2) == RECORD_TYPE
                 ? "struct "
                 : TREE_CODE (type2) == UNION_TYPE
                   ? "union " : "", tname,
                 deref_depth == 0 ? "" : " ");

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
@ 2020-10-29  8:47 ` jakub at gcc dot gnu.org
  2020-10-29  8:55 ` marxin at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-29  8:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Why do you think it is a bug?
Yes, it prints the opening quote, then
      while (deref_depth-- > 0)
        pp_star (&pretty_name);
prints some * characters and finally
      pp_quote (&pretty_name);
prints the closing '

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
  2020-10-29  8:47 ` [Bug bootstrap/97622] " jakub at gcc dot gnu.org
@ 2020-10-29  8:55 ` marxin at gcc dot gnu.org
  2020-10-29 17:24 ` euloanty at live dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-29  8:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-10-29
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
  2020-10-29  8:47 ` [Bug bootstrap/97622] " jakub at gcc dot gnu.org
  2020-10-29  8:55 ` marxin at gcc dot gnu.org
@ 2020-10-29 17:24 ` euloanty at live dot com
  2020-10-29 17:24 ` euloanty at live dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: euloanty at live dot com @ 2020-10-29 17:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #2 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Jakub Jelinek from comment #1)
> Why do you think it is a bug?
> Yes, it prints the opening quote, then
>       while (deref_depth-- > 0)
>         pp_star (&pretty_name);
> prints some * characters and finally
>       pp_quote (&pretty_name);
> prints the closing '

Shouldn't that be "\'" instead of "'"?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
                   ` (2 preceding siblings ...)
  2020-10-29 17:24 ` euloanty at live dot com
@ 2020-10-29 17:24 ` euloanty at live dot com
  2020-10-29 17:42 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: euloanty at live dot com @ 2020-10-29 17:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #3 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Jakub Jelinek from comment #1)
> Why do you think it is a bug?
> Yes, it prints the opening quote, then
>       while (deref_depth-- > 0)
>         pp_star (&pretty_name);
> prints some * characters and finally
>       pp_quote (&pretty_name);
> prints the closing '

Because the compiler warns about it.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
                   ` (3 preceding siblings ...)
  2020-10-29 17:24 ` euloanty at live dot com
@ 2020-10-29 17:42 ` jakub at gcc dot gnu.org
  2020-10-29 19:56 ` euloanty at live dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-29 17:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
No.
If it is the -Wformat-diag warning, just ignore it.  It has been added without
any attempt to resolve the warnings and warns for many things that are just
fine.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
                   ` (4 preceding siblings ...)
  2020-10-29 17:42 ` jakub at gcc dot gnu.org
@ 2020-10-29 19:56 ` euloanty at live dot com
  2020-10-30 14:52 ` msebor at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: euloanty at live dot com @ 2020-10-29 19:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

fdlbxtqi <euloanty at live dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
                   ` (5 preceding siblings ...)
  2020-10-29 19:56 ` euloanty at live dot com
@ 2020-10-30 14:52 ` msebor at gcc dot gnu.org
  2020-10-30 15:13 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-10-30 14:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |---
           Keywords|                            |diagnostic
                 CC|                            |msebor at gcc dot gnu.org
             Status|RESOLVED                    |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> No.
> If it is the -Wformat-diag warning, just ignore it.  It has been added
> without any attempt to resolve the warnings and warns for many things that
> are just fine.

Without any attempt?  Hardly.  I committed a 12 patch series to resolve most
instances when I introduced the warning:
  https://gcc.gnu.org/pipermail/gcc-patches/2019-May/521567.html
And then proceeded to clean up more here:
  https://gcc.gnu.org/pipermail/gcc-patches/2019-May/522333.html
and more still here:
  https://gcc.gnu.org/pipermail/gcc-patches/2019-June/523281.html

Others have cleaned up a bunch more later that either remained or crept in
because the warning doesn't trigger errors.  See r272607, r272608, r272789,
r273468, r273475, and more.

The few outstanding instances should be fixed and the error suppression for the
warning removed.  The one in comment #0 can be worked around with by making the
quote an argument to a %c.  An an arguably more robust solution would be to
introduce another attribute that doesn't enforce some of the rules for
pp_printf().

Let me take care of this.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
                   ` (6 preceding siblings ...)
  2020-10-30 14:52 ` msebor at gcc dot gnu.org
@ 2020-10-30 15:13 ` jakub at gcc dot gnu.org
  2020-11-25  1:11 ` msebor at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-30 15:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
There are still 81 warnings on x86_64-linux at unique spots during bootstrap
more than a year after the warning has been added, and at least several of
those aren't really bugs in the code, so the question is if we want to slow
things down by adding workarounds for the warning.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
                   ` (7 preceding siblings ...)
  2020-10-30 15:13 ` jakub at gcc dot gnu.org
@ 2020-11-25  1:11 ` msebor at gcc dot gnu.org
  2020-11-25 22:01 ` cvs-commit at gcc dot gnu.org
  2020-11-25 22:05 ` msebor at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-11-25  1:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2020-November/560129.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
                   ` (8 preceding siblings ...)
  2020-11-25  1:11 ` msebor at gcc dot gnu.org
@ 2020-11-25 22:01 ` cvs-commit at gcc dot gnu.org
  2020-11-25 22:05 ` msebor at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-25 22:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:

https://gcc.gnu.org/g:ca23341b28cd3af7985b83a6479107d9ea145a90

commit r11-5393-gca23341b28cd3af7985b83a6479107d9ea145a90
Author: Martin Sebor <msebor@redhat.com>
Date:   Wed Nov 25 14:05:01 2020 -0700

    Clean up -Wformat-diag warnings (PR bootstrap/97622, PR bootstrap/94982)

    gcc/c-family/ChangeLog:

            PR bootstrap/94982
            * c-attribs.c (handle_patchable_function_entry_attribute): Avoid
            -Wformat-diag.

    gcc/cp/ChangeLog:

            PR bootstrap/94982
            * constraint.cc (debug_argument_list): Avoid -Wformat-diag.
            * error.c (function_category): Same.
            (print_template_differences): Same.
            * logic.cc (debug): Same.
            * name-lookup.c (lookup_using_decl): Same.
            * parser.c (maybe_add_cast_fixit): Same.
            (cp_parser_template_introduction): Same.
            * typeck.c (access_failure_info::add_fixit_hint): Same.

    gcc/ChangeLog:

            PR bootstrap/97622
            PR bootstrap/94982
            * config/i386/i386-options.c (ix86_valid_target_attribute_inner_p):
            Avoid -Wformat-diag.
            * digraph.cc (struct test_edge): Same.
            * dumpfile.c (dump_loc): Same.
            (dump_context::begin_scope): Same.
            * edit-context.c (edited_file::print_diff): Same.
            (edited_file::print_diff_hunk): Same.
            * json.cc (object::print): Same.
            * lto-wrapper.c (merge_and_complain): Same.
            * reload.c (find_reloads): Same.
            * tree-diagnostic-path.cc (print_path_summary_as_text): Same.
            * ubsan.c (ubsan_type_descriptor): Same.

    gcc/jit/ChangeLog:

            PR bootstrap/94982
            * jit-recording.c (recording::function::dump_to_dot): Avoid
            -Wformat-diag.
            (recording::block::dump_to_dot): Same.

    gcc/testsuite/ChangeLog:

            PR bootstrap/94982
            * c-c++-common/patchable_function_entry-error-3.c: Adjust text
            of expected warning.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug bootstrap/97622] ubsan '  unterminated quote character ''' in format
  2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
                   ` (9 preceding siblings ...)
  2020-11-25 22:01 ` cvs-commit at gcc dot gnu.org
@ 2020-11-25 22:05 ` msebor at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-11-25 22:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
With the patch committed in r11-5393 the warning should be gone.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-11-25 22:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29  0:22 [Bug bootstrap/97622] New: ubsan ' unterminated quote character ''' in format euloanty at live dot com
2020-10-29  8:47 ` [Bug bootstrap/97622] " jakub at gcc dot gnu.org
2020-10-29  8:55 ` marxin at gcc dot gnu.org
2020-10-29 17:24 ` euloanty at live dot com
2020-10-29 17:24 ` euloanty at live dot com
2020-10-29 17:42 ` jakub at gcc dot gnu.org
2020-10-29 19:56 ` euloanty at live dot com
2020-10-30 14:52 ` msebor at gcc dot gnu.org
2020-10-30 15:13 ` jakub at gcc dot gnu.org
2020-11-25  1:11 ` msebor at gcc dot gnu.org
2020-11-25 22:01 ` cvs-commit at gcc dot gnu.org
2020-11-25 22:05 ` msebor at gcc dot gnu.org

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).