This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix various cases of missing whitespace in string literals split across lines


On 02/13/2017 12:42 PM, Jakub Jelinek wrote:
Hi!

While looking at PR79475 (already fixed), I wrote a small scriptlet
#!/bin/awk -f
/^[[:blank:]]*"[^[:blank:]]/ {
  if (last)
    {
      print last
      print
    }
}
{
  last = ""
}
/[^[:blank:]]"[[:blank:]]*\\?$/ {
  if ($0 ~ /\\[tnv]"[[:blank:]]*\\?$/)
    last = ""
  else
    last = $0
}
to look for possible issues like
	"something"
	"and something"
where there probably is supposed to be a space in between.  It shows
various false positives (especially in the spec handling stuff) and while
it handles
	"something\n"
	"something else"
it doesn't handle
	"something"
	"\nsomething else"
but in any case the false positive ratio was small enough that I could
easily look for actual bugs.  This patch fixes various of these
in the middle end as well as C and fortran FEs.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2017-02-13  Jakub Jelinek  <jakub@redhat.com>

	* cprop.c (cprop_jump): Add missing space in string literal.
	* tree-ssa-structalias.c (rewrite_constraints): Likewise.
	(get_constraint_for_component_ref): Likewise.
	* df-core.c (df_worklist_dataflow_doublequeue): Likewise.
	* tree-outof-ssa.c (insert_partition_copy_on_edge): Likewise.
	* lra-constraints.c (process_alt_operands): Likewise.
	* ipa-inline.c (inline_small_functions): Likewise.
	* tree-ssa-sccvn.c (visit_reference_op_store): Likewise.
	* cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Likewise.
	* trans-mem.c (diagnose_tm_1_op): Likewise.
	* omp-grid.c (grid_find_single_omp_among_assignments): Likewise.
	(grid_parallel_clauses_gridifiable): Likewise.
c/
	* c-parser.c (c_parser_oacc_declare): Add missing space in
	diagnostics.
fortran/
	* trans-expr.c (gfc_conv_substring): Add missing space in diagnostics.
OK.
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]