* [PATCH] Fix -Wformat-security warnings in dwarf2out.c
@ 2017-01-20 23:30 Jakub Jelinek
2017-01-23 17:10 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2017-01-20 23:30 UTC (permalink / raw)
To: Jason Merrill, Jeff Law; +Cc: gcc-patches
Hi!
When building gcc with -Wformat -Werror=format-security, there are various
warnings->errors. This set has been introduced by me :( in the DWARF5
work, thus it is a 7 Regression.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?
2017-01-20 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (output_compilation_unit_header, output_file_names):
Avoid -Wformat-security warning.
--- gcc/dwarf2out.c.jj 2017-01-19 16:58:12.000000000 +0100
+++ gcc/dwarf2out.c 2017-01-20 12:51:10.466654949 +0100
@@ -10286,7 +10286,7 @@ output_compilation_unit_header (enum dwa
case DW_UT_split_type: name = "DW_UT_split_type"; break;
default: gcc_unreachable ();
}
- dw2_asm_output_data (1, ut, name);
+ dw2_asm_output_data (1, ut, "%s", name);
dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
}
dw2_asm_output_offset (DWARF_OFFSET_SIZE, abbrev_section_label,
@@ -11551,7 +11551,8 @@ output_file_names (void)
if (DWARF5_USE_DEBUG_LINE_STR)
str_form = DW_FORM_line_strp;
dw2_asm_output_data_uleb128 (DW_LNCT_path, "DW_LNCT_path");
- dw2_asm_output_data_uleb128 (str_form, get_DW_FORM_name (str_form));
+ dw2_asm_output_data_uleb128 (str_form, "%s",
+ get_DW_FORM_name (str_form));
dw2_asm_output_data_uleb128 (ndirs + idx_offset, "Directories count");
if (str_form == DW_FORM_string)
{
@@ -11631,10 +11632,12 @@ output_file_names (void)
dw2_asm_output_data (1, 2, "File name entry format count");
#endif
dw2_asm_output_data_uleb128 (DW_LNCT_path, "DW_LNCT_path");
- dw2_asm_output_data_uleb128 (str_form, get_DW_FORM_name (str_form));
+ dw2_asm_output_data_uleb128 (str_form, "%s",
+ get_DW_FORM_name (str_form));
dw2_asm_output_data_uleb128 (DW_LNCT_directory_index,
"DW_LNCT_directory_index");
- dw2_asm_output_data_uleb128 (idx_form, get_DW_FORM_name (idx_form));
+ dw2_asm_output_data_uleb128 (idx_form, "%s",
+ get_DW_FORM_name (idx_form));
#ifdef VMS_DEBUGGING_INFO
dw2_asm_output_data_uleb128 (DW_LNCT_timestamp, "DW_LNCT_timestamp");
dw2_asm_output_data_uleb128 (DW_FORM_udata, "DW_FORM_udata");
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix -Wformat-security warnings in dwarf2out.c
2017-01-20 23:30 [PATCH] Fix -Wformat-security warnings in dwarf2out.c Jakub Jelinek
@ 2017-01-23 17:10 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2017-01-23 17:10 UTC (permalink / raw)
To: Jakub Jelinek, Jason Merrill; +Cc: gcc-patches
On 01/20/2017 04:24 PM, Jakub Jelinek wrote:
> Hi!
>
> When building gcc with -Wformat -Werror=format-security, there are various
> warnings->errors. This set has been introduced by me :( in the DWARF5
> work, thus it is a 7 Regression.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?
>
> 2017-01-20 Jakub Jelinek <jakub@redhat.com>
>
> * dwarf2out.c (output_compilation_unit_header, output_file_names):
> Avoid -Wformat-security warning.
OK. I'd consider these obvious, so if there's others you find, no need
to wait on an approval.
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-23 17:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 23:30 [PATCH] Fix -Wformat-security warnings in dwarf2out.c Jakub Jelinek
2017-01-23 17:10 ` Jeff Law
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).