[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-11-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Martin Sebor  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #9 from Martin Sebor  ---
With the patch committed in r11-5393 the warning should be gone.

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-11-25 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

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

commit r11-5393-gca23341b28cd3af7985b83a6479107d9ea145a90
Author: Martin Sebor 
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.

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-11-24 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch

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

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-10-30 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #6 from Jakub Jelinek  ---
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.

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-10-30 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Martin Sebor  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  ---
(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.

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-10-29 Thread euloanty at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

fdlbxtqi  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|WAITING |RESOLVED

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-10-29 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #4 from Jakub Jelinek  ---
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.

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-10-29 Thread euloanty at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #3 from fdlbxtqi  ---
(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.

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-10-29 Thread euloanty at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

--- Comment #2 from fdlbxtqi  ---
(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 "'"?

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-10-29 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Martin Liška  changed:

   What|Removed |Added

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

[Bug bootstrap/97622] ubsan ' unterminated quote character ''' in format

2020-10-29 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97622

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
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 '