1 GCC with `-Wformat-security -Werror=format-security` hardening options enabled
2 by default rejects some codes in libcpp. This patch fixes them.
4 --- gcc-8.3.0/libcpp/expr.cc.bak 2020-09-11 15:44:45.770000000 +0900
5 +++ gcc-8.3.0/libcpp/expr.cc 2020-09-11 15:46:22.370000000 +0900
8 if (CPP_OPTION (pfile, c99))
9 cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
13 cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG,
14 - virtual_location, 0, message);
15 + virtual_location, 0, "%s", message);
18 result |= CPP_N_INTEGER;
19 --- gcc-8.3.0/libcpp/macro.cc.bak 2020-09-11 16:01:42.550000000 +0900
20 +++ gcc-8.3.0/libcpp/macro.cc 2020-09-11 16:03:47.850000000 +0900
22 if (m_state == 2 && token->type == CPP_PASTE)
24 cpp_error_at (m_pfile, CPP_DL_ERROR, token->src_loc,
26 + "%s", vaopt_paste_error);
29 /* Advance states before further considering this token, in
33 cpp_error_at (m_pfile, CPP_DL_ERROR, token->src_loc,
35 + "%s", vaopt_paste_error);
40 function-like macros, but not at the end. */
41 if (following_paste_op)
43 - cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
44 + cpp_error (pfile, CPP_DL_ERROR, "%s", paste_op_error_msg);
47 if (!vaopt_tracker.completed ())
49 function-like macros, but not at the beginning. */
50 if (macro->count == 1)
52 - cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
53 + cpp_error (pfile, CPP_DL_ERROR, "%s", paste_op_error_msg);