Bootstrapped and regtested on x86_64-redhat-linux, ppc64le-redhat-linux and s390x-redhat-linux.
Ok for master? --- Bootstrap with musl libc fails with numerous "missing sentinel in function call" errors. This is because musl defines NULL as 0L for C++, but gcc requires sentinel value to be a pointer or __null. Jonathan Wakely says: To be really safe during stage 1, GCC should not use NULL as a pointer sentinel in C++ code anyway. The bootstrap compiler could define it to 0 or 0u, neither of which is guaranteed to be OK to pass as a varargs sentinel where a null pointer is expected. Any of (void*)0 or (void*)NULL or nullptr would be safe. Therefore, fix by replacing NULL sentinels with nullptr. gcc/ChangeLog: 2020-06-17 Ilya Leoshkevich <i...@linux.ibm.com> PR bootstrap/95700 * builtins.c (do_mpfr_remquo): Use nullptr as a sentinel. * collect-utils.c (collect_execute): Likewise. * collect2.c (main): Likewise. (write_c_file_stat): Likewise. * config/i386/driver-i386.c (describe_cache): Likewise. (host_detect_local_cpu): Likewise. * config/i386/i386.c (x86_64_elf_unique_section): Likewise. * coverage.c (coverage_init): Likewise. * dbxout.c (dbxout_init): Likewise. * dumpfile.c (get_dump_file_name): Likewise. * dwarf2out.c (add_top_level_skeleton_die_attrs): Likewise. (add_enumerator_pubname): Likewise. (add_pubtype): Likewise. (gen_subprogram_die): Likewise. * expr.c (build_personality_function): Likewise. * fold-const-call.c (do_mpfr_sincos): Likewise. (do_mpfr_arg2): Likewise. (do_mpfr_arg3): Likewise. * gcc-ar.c (setup_prefixes): Likewise. (main): Likewise. * gcc.c (set_spec): Likewise. (close_at_file): Likewise. (for_each_path): Likewise. (add_sysrooted_prefix): Likewise. (add_sysrooted_hdrs_prefix): Likewise. (process_command): Likewise. (do_spec_1): Likewise. (driver::set_up_specs): Likewise. (driver::maybe_run_linker): Likewise. (driver::detect_jobserver): Likewise. (set_multilib_dir): Likewise. (find_plugindir_spec_function): Likewise. (compare_debug_dump_opt_spec_function): Likewise. (compare_debug_self_opt_spec_function): Likewise. (pass_through_libs_spec_func): Likewise. (dumps_spec_func): Likewise. (find_fortran_preinclude_file): Likewise. * genattrtab.c (evaluate_eq_attr): Likewise. * gencfn-macros.c (is_group): Likewise. * genconstants.c (print_enum_type): Likewise. * gengtype-state.c (write_state): Likewise. (read_state_fileloc): Likewise. * gengtype.c (close_output_files): Likewise. (write_field_root): Likewise. (write_root): Likewise. * genmatch.c (get_operator): Likewise. * hsa-brig.c (brig_init): Likewise. * incpath.c (add_standard_paths): Likewise. (add_sysroot_to_chain): Likewise. * lto-streamer.c (lto_get_section_name): Likewise. * lto-wrapper.c (debug_objcopy): Likewise. (run_gcc): Likewise. * omp-low.c (lower_omp_critical): Likewise. * opt-suggestions.c (option_proposer::build_option_suggestions): Likewise. * optinfo-emit-json.cc (optrecord_json_writer::write): Likewise. * opts.c (print_filtered_help): Likewise. (option_name): Likewise. (get_option_url): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * plugin.c: Likewise. * prefix.c (translate_name): Likewise. (update_path): Likewise. * print-tree.c (print_decl_identifier): Likewise. * read-md.c (md_reader::join_c_conditions): Likewise. (md_reader::handle_enum): Likewise. (md_reader::handle_include): Likewise. * read-rtl.c (get_mode_token): Likewise. * real.c (build_sinatan_real): Likewise. * selftest.c (locate_file): Likewise. * targhooks.c (default_mangle_assembler_name): Likewise. * toplev.c (compile_file): Likewise. (open_auxiliary_file): Likewise. * trans-mem.c (tm_mangle): Likewise. * tree-complex.c (create_one_component_var): Likewise. * tree-nested.c (get_frame_type): Likewise. * tree-profile.c (gimple_init_gcov_profiler): Likewise. * tree-vect-data-refs.c (vect_get_new_vect_var): Likewise. (vect_get_new_ssa_name): Likewise. * tree.c (build_common_builtin_nodes): Likewise. * varasm.c (get_named_text_section): Likewise. (default_unique_section): Likewise. (default_asm_output_ident_directive): Likewise. gcc/analyzer/ChangeLog: 2020-06-17 Ilya Leoshkevich <i...@linux.ibm.com> PR bootstrap/95700 * region-model.cc (region::dump_to_pp): Use nullptr as a sentinel. gcc/c-family/ChangeLog: 2020-06-17 Ilya Leoshkevich <i...@linux.ibm.com> PR bootstrap/95700 * c-ada-spec.c (dump_ads): Use nullptr as a sentinel. * c-format.c (get_corrected_substring): Likewise. (class range_label_for_format_type_mismatch): Likewise. gcc/c/ChangeLog: 2020-06-17 Ilya Leoshkevich <i...@linux.ibm.com> PR bootstrap/95700 * c-aux-info.c (affix_data_type): Use nullptr as a sentinel. (gen_formal_list_for_type): Likewise. (gen_formal_list_for_func_def): Likewise. (gen_type): Likewise. (gen_decl): Likewise. gcc/cp/ChangeLog: 2020-06-17 Ilya Leoshkevich <i...@linux.ibm.com> PR bootstrap/95700 * call.c (print_z_candidate): Use nullptr as a sentinel. (op_error_string): Likewise. (name_as_c_string): Likewise. * vtable-class-hierarchy.c (get_log_file_name): Likewise. (insert_call_to_register_set): Likewise. gcc/fortran/ChangeLog: 2020-06-17 Ilya Leoshkevich <i...@linux.ibm.com> PR bootstrap/95700 * arith.c (gfc_arith_init_1): Use nullptr as a sentinel. (gfc_arith_done_1): Likewise. * error.c (gfc_diagnostic_starter): Likewise. * simplify.c (asympt_erfc_scaled): Likewise. (gfc_simplify_scale): Likewise. (gfc_simplify_set_exponent): Likewise. gcc/objc/ChangeLog: 2020-06-17 Ilya Leoshkevich <i...@linux.ibm.com> PR bootstrap/95700 * objc-act.c (objc_write_global_declarations): Use nullptr as a sentinel. --- gcc/analyzer/region-model.cc | 4 +- gcc/builtins.c | 4 +- gcc/c-family/c-ada-spec.c | 2 +- gcc/c-family/c-format.c | 4 +- gcc/c/c-aux-info.c | 84 +++++++++++++-------------- gcc/collect-utils.c | 2 +- gcc/collect2.c | 8 +-- gcc/config/i386/driver-i386.c | 6 +- gcc/config/i386/i386.c | 2 +- gcc/coverage.c | 2 +- gcc/cp/call.c | 14 ++--- gcc/cp/vtable-class-hierarchy.c | 4 +- gcc/dbxout.c | 2 +- gcc/dumpfile.c | 4 +- gcc/dwarf2out.c | 10 ++-- gcc/expr.c | 2 +- gcc/fold-const-call.c | 12 ++-- gcc/fortran/arith.c | 4 +- gcc/fortran/error.c | 4 +- gcc/fortran/simplify.c | 6 +- gcc/gcc-ar.c | 16 ++--- gcc/gcc.c | 100 ++++++++++++++++---------------- gcc/genattrtab.c | 2 +- gcc/gencfn-macros.c | 2 +- gcc/genconstants.c | 2 +- gcc/gengtype-state.c | 4 +- gcc/gengtype.c | 8 +-- gcc/genmatch.c | 6 +- gcc/hsa-brig.c | 2 +- gcc/incpath.c | 14 ++--- gcc/lto-streamer.c | 2 +- gcc/lto-wrapper.c | 16 ++--- gcc/objc/objc-act.c | 2 +- gcc/omp-low.c | 2 +- gcc/opt-suggestions.c | 4 +- gcc/optinfo-emit-json.cc | 2 +- gcc/opts.c | 6 +- gcc/passes.c | 8 +-- gcc/plugin.c | 2 +- gcc/prefix.c | 8 +-- gcc/print-tree.c | 2 +- gcc/read-md.c | 8 +-- gcc/read-rtl.c | 2 +- gcc/real.c | 4 +- gcc/selftest.c | 2 +- gcc/targhooks.c | 2 +- gcc/toplev.c | 4 +- gcc/trans-mem.c | 4 +- gcc/tree-complex.c | 2 +- gcc/tree-nested.c | 2 +- gcc/tree-profile.c | 12 ++-- gcc/tree-vect-data-refs.c | 4 +- gcc/tree.c | 4 +- gcc/varasm.c | 8 +-- 54 files changed, 224 insertions(+), 224 deletions(-) diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 0794be9a583..8d35bd10967 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -1422,14 +1422,14 @@ region::dump_to_pp (const region_model &model, const char *new_prefix; if (!m_parent_rid.null_p ()) - new_prefix = ACONCAT ((prefix, is_last_child ? " " : "| ", NULL)); + new_prefix = ACONCAT ((prefix, is_last_child ? " " : "| ", nullptr)); else new_prefix = prefix; const char *begin_color = colorize_start (pp_show_color (pp), "note"); const char *end_color = colorize_stop (pp_show_color (pp)); char *field_prefix - = ACONCAT ((begin_color, new_prefix, "|:", end_color, NULL)); + = ACONCAT ((begin_color, new_prefix, "|:", end_color, nullptr)); if (!m_sval_id.null_p ()) { diff --git a/gcc/builtins.c b/gcc/builtins.c index 4754602e0ec..af243baf7e1 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -11569,7 +11569,7 @@ do_mpfr_remquo (tree arg0, tree arg1, tree arg_quo) long integer_quo; mpfr_t m0, m1; - mpfr_inits2 (prec, m0, m1, NULL); + mpfr_inits2 (prec, m0, m1, nullptr); mpfr_from_real (m0, ra0, MPFR_RNDN); mpfr_from_real (m1, ra1, MPFR_RNDN); mpfr_clear_flags (); @@ -11577,7 +11577,7 @@ do_mpfr_remquo (tree arg0, tree arg1, tree arg_quo) /* Remquo is independent of the rounding mode, so pass inexact=0 to do_mpfr_ckconv(). */ result_rem = do_mpfr_ckconv (m0, type, /*inexact=*/ 0); - mpfr_clears (m0, m1, NULL); + mpfr_clears (m0, m1, nullptr); if (result_rem) { /* MPFR calculates quo in the host's long so it may diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index c75b173eec3..745f588deaa 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -3389,7 +3389,7 @@ dump_ads (const char *source_file, else *s = TOLOWER (*s); - ads_name = reconcat (ads_name, ads_name, ".ads", NULL); + ads_name = reconcat (ads_name, ads_name, ".ads", nullptr); /* Write out the .ads file. */ f = fopen (ads_name, "w"); diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 77d24ad94e4..e181c0cfa96 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -4558,7 +4558,7 @@ get_corrected_substring (const substring_loc &fmt_loc, /* Success. Generate the resulting suggestion for the whole range of FMT_LOC by concatenating the two strings. In the above example, this would be "%-+*.*ld". */ - char *result = concat (prefix, format_for_type, NULL); + char *result = concat (prefix, format_for_type, nullptr); free (format_for_type); free (prefix); return result; @@ -4631,7 +4631,7 @@ class range_label_for_format_type_mismatch char *p = (char *) alloca (suffix.get_buffer_size ()); suffix.fill_buffer (p); - char *result = concat (text.m_buffer, p, NULL); + char *result = concat (text.m_buffer, p, nullptr); text.maybe_free (); return label_text::take (result); } diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c index ffc8099856d..6c0fea1df20 100644 --- a/gcc/c/c-aux-info.c +++ b/gcc/c/c-aux-info.c @@ -91,7 +91,7 @@ affix_data_type (const char *param) qualifiers_then_data_type = concat (type_or_decl, data_type, NULL); *p = saved; return reconcat (qualifiers_then_data_type, - qualifiers_then_data_type, " ", p, NULL); + qualifiers_then_data_type, " ", p, nullptr); } /* Given a tree node which represents some "function type", generate the @@ -116,7 +116,7 @@ gen_formal_list_for_type (tree fntype, formals_style style) const char *this_type; if (*formal_list) - formal_list = concat (formal_list, ", ", NULL); + formal_list = concat (formal_list, ", ", nullptr); this_type = gen_type ("", TREE_VALUE (formal_type), ansi); formal_list @@ -171,10 +171,10 @@ gen_formal_list_for_type (tree fntype, formals_style style) petered out to a NULL (i.e. without being terminated by a void_type_node) then we need to tack on an ellipsis. */ if (!formal_type) - formal_list = concat (formal_list, ", ...", NULL); + formal_list = concat (formal_list, ", ...", nullptr); } - return concat (" (", formal_list, ")", NULL); + return concat (" (", formal_list, ")", nullptr); } /* Generate a parameter list for a function definition (in some given style). @@ -208,23 +208,23 @@ gen_formal_list_for_func_def (tree fndecl, formals_style style) const char *this_formal; if (*formal_list && ((style == ansi) || (style == k_and_r_names))) - formal_list = concat (formal_list, ", ", NULL); + formal_list = concat (formal_list, ", ", nullptr); this_formal = gen_decl (formal_decl, 0, style); if (style == k_and_r_decls) - formal_list = concat (formal_list, this_formal, "; ", NULL); + formal_list = concat (formal_list, this_formal, "; ", nullptr); else - formal_list = concat (formal_list, this_formal, NULL); + formal_list = concat (formal_list, this_formal, nullptr); formal_decl = TREE_CHAIN (formal_decl); } if (style == ansi) { if (!DECL_ARGUMENTS (fndecl)) - formal_list = concat (formal_list, "void", NULL); + formal_list = concat (formal_list, "void", nullptr); if (stdarg_p (TREE_TYPE (fndecl))) - formal_list = concat (formal_list, ", ...", NULL); + formal_list = concat (formal_list, ", ...", nullptr); } if ((style == ansi) || (style == k_and_r_names)) - formal_list = concat (" (", formal_list, ")", NULL); + formal_list = concat (" (", formal_list, ")", nullptr); return formal_list; } @@ -283,16 +283,16 @@ gen_type (const char *ret_val, tree t, formals_style style) { case POINTER_TYPE: if (TYPE_ATOMIC (t)) - ret_val = concat ("_Atomic ", ret_val, NULL); + ret_val = concat ("_Atomic ", ret_val, nullptr); if (TYPE_READONLY (t)) - ret_val = concat ("const ", ret_val, NULL); + ret_val = concat ("const ", ret_val, nullptr); if (TYPE_VOLATILE (t)) - ret_val = concat ("volatile ", ret_val, NULL); + ret_val = concat ("volatile ", ret_val, nullptr); - ret_val = concat ("*", ret_val, NULL); + ret_val = concat ("*", ret_val, nullptr); if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) - ret_val = concat ("(", ret_val, ")", NULL); + ret_val = concat ("(", ret_val, ")", nullptr); ret_val = gen_type (ret_val, TREE_TYPE (t), style); @@ -300,10 +300,10 @@ gen_type (const char *ret_val, tree t, formals_style style) case ARRAY_TYPE: if (!COMPLETE_TYPE_P (t) || TREE_CODE (TYPE_SIZE (t)) != INTEGER_CST) - ret_val = gen_type (concat (ret_val, "[]", NULL), + ret_val = gen_type (concat (ret_val, "[]", nullptr), TREE_TYPE (t), style); else if (int_size_in_bytes (t) == 0) - ret_val = gen_type (concat (ret_val, "[0]", NULL), + ret_val = gen_type (concat (ret_val, "[0]", nullptr), TREE_TYPE (t), style); else { @@ -311,7 +311,7 @@ gen_type (const char *ret_val, tree t, formals_style style) sprintf (buff, "[" HOST_WIDE_INT_PRINT_DEC"]", int_size_in_bytes (t) / int_size_in_bytes (TREE_TYPE (t))); - ret_val = gen_type (concat (ret_val, buff, NULL), + ret_val = gen_type (concat (ret_val, buff, nullptr), TREE_TYPE (t), style); } break; @@ -319,7 +319,7 @@ gen_type (const char *ret_val, tree t, formals_style style) case FUNCTION_TYPE: ret_val = gen_type (concat (ret_val, gen_formal_list_for_type (t, style), - NULL), + nullptr), TREE_TYPE (t), style); break; @@ -348,13 +348,13 @@ gen_type (const char *ret_val, tree t, formals_style style) while (chain_p) { data_type = concat (data_type, gen_decl (chain_p, 0, ansi), - NULL); + nullptr); chain_p = TREE_CHAIN (chain_p); - data_type = concat (data_type, "; ", NULL); + data_type = concat (data_type, "; ", nullptr); } - data_type = concat ("{ ", data_type, "}", NULL); + data_type = concat ("{ ", data_type, "}", nullptr); } - data_type = concat ("struct ", data_type, NULL); + data_type = concat ("struct ", data_type, nullptr); break; case UNION_TYPE: @@ -367,13 +367,13 @@ gen_type (const char *ret_val, tree t, formals_style style) while (chain_p) { data_type = concat (data_type, gen_decl (chain_p, 0, ansi), - NULL); + nullptr); chain_p = TREE_CHAIN (chain_p); - data_type = concat (data_type, "; ", NULL); + data_type = concat (data_type, "; ", nullptr); } - data_type = concat ("{ ", data_type, "}", NULL); + data_type = concat ("{ ", data_type, "}", nullptr); } - data_type = concat ("union ", data_type, NULL); + data_type = concat ("union ", data_type, nullptr); break; case ENUMERAL_TYPE: @@ -386,14 +386,14 @@ gen_type (const char *ret_val, tree t, formals_style style) while (chain_p) { data_type = concat (data_type, - IDENTIFIER_POINTER (TREE_PURPOSE (chain_p)), NULL); + IDENTIFIER_POINTER (TREE_PURPOSE (chain_p)), nullptr); chain_p = TREE_CHAIN (chain_p); if (chain_p) - data_type = concat (data_type, ", ", NULL); + data_type = concat (data_type, ", ", nullptr); } - data_type = concat ("{ ", data_type, " }", NULL); + data_type = concat ("{ ", data_type, " }", nullptr); } - data_type = concat ("enum ", data_type, NULL); + data_type = concat ("enum ", data_type, nullptr); break; case TYPE_DECL: @@ -406,7 +406,7 @@ gen_type (const char *ret_val, tree t, formals_style style) /* Normally, `unsigned' is part of the deal. Not so if it comes with a type qualifier. */ if (TYPE_UNSIGNED (t) && TYPE_QUALS (t)) - data_type = concat ("unsigned ", data_type, NULL); + data_type = concat ("unsigned ", data_type, nullptr); break; case REAL_TYPE: @@ -426,13 +426,13 @@ gen_type (const char *ret_val, tree t, formals_style style) } } if (TYPE_ATOMIC (t)) - ret_val = concat ("_Atomic ", ret_val, NULL); + ret_val = concat ("_Atomic ", ret_val, nullptr); if (TYPE_READONLY (t)) - ret_val = concat ("const ", ret_val, NULL); + ret_val = concat ("const ", ret_val, nullptr); if (TYPE_VOLATILE (t)) - ret_val = concat ("volatile ", ret_val, NULL); + ret_val = concat ("volatile ", ret_val, nullptr); if (TYPE_RESTRICT (t)) - ret_val = concat ("restrict ", ret_val, NULL); + ret_val = concat ("restrict ", ret_val, nullptr); return ret_val; } @@ -471,9 +471,9 @@ gen_decl (tree decl, int is_func_definition, formals_style style) generate the qualifiers here. */ if (TREE_THIS_VOLATILE (decl)) - ret_val = concat ("volatile ", ret_val, NULL); + ret_val = concat ("volatile ", ret_val, nullptr); if (TREE_READONLY (decl)) - ret_val = concat ("const ", ret_val, NULL); + ret_val = concat ("const ", ret_val, nullptr); data_type = ""; @@ -492,7 +492,7 @@ gen_decl (tree decl, int is_func_definition, formals_style style) if (TREE_CODE (decl) == FUNCTION_DECL && is_func_definition) { ret_val = concat (ret_val, gen_formal_list_for_func_def (decl, ansi), - NULL); + nullptr); /* Since we have already added in the formals list stuff, here we don't add the whole "type" of the function we are considering (which @@ -509,11 +509,11 @@ gen_decl (tree decl, int is_func_definition, formals_style style) ret_val = affix_data_type (ret_val); if (TREE_CODE (decl) != FUNCTION_DECL && C_DECL_REGISTER (decl)) - ret_val = concat ("register ", ret_val, NULL); + ret_val = concat ("register ", ret_val, nullptr); if (TREE_PUBLIC (decl)) - ret_val = concat ("extern ", ret_val, NULL); + ret_val = concat ("extern ", ret_val, nullptr); if (TREE_CODE (decl) == FUNCTION_DECL && !TREE_PUBLIC (decl)) - ret_val = concat ("static ", ret_val, NULL); + ret_val = concat ("static ", ret_val, nullptr); return ret_val; } diff --git a/gcc/collect-utils.c b/gcc/collect-utils.c index d4fa2c3d345..c5b271556ce 100644 --- a/gcc/collect-utils.c +++ b/gcc/collect-utils.c @@ -146,7 +146,7 @@ collect_execute (const char *prog, char **argv, const char *outname, fatal_error (input_location, "could not close response file %s", response_file); - response_arg = concat ("@", response_file, NULL); + response_arg = concat ("@", response_file, nullptr); response_argv[0] = argv0; response_argv[1] = response_arg; response_argv[2] = NULL; diff --git a/gcc/collect2.c b/gcc/collect2.c index f8a5ce45994..210ac960bec 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -1182,8 +1182,8 @@ main (int argc, char **argv) /* Make temp file names. */ if (save_temps) { - c_file = concat (output_file, ".cdtor.c", NULL); - o_file = concat (output_file, ".cdtor.o", NULL); + c_file = concat (output_file, ".cdtor.c", nullptr); + o_file = concat (output_file, ".cdtor.o", nullptr); #ifdef COLLECT_EXPORT_LIST export_file = concat (output_file, ".x", NULL); #endif @@ -2067,8 +2067,8 @@ write_c_file_stat (FILE *stream, const char *name ATTRIBUTE_UNUSED) notice ("\nwrite_c_file - output name is %s, prefix is %s\n", output_file, prefix); - initname = concat ("_GLOBAL__FI_", prefix, NULL); - fininame = concat ("_GLOBAL__FD_", prefix, NULL); + initname = concat ("_GLOBAL__FI_", prefix, nullptr); + fininame = concat ("_GLOBAL__FD_", prefix, nullptr); #ifdef TARGET_AIX_VERSION aix_shared_initname = concat ("_GLOBAL__AIXI_", prefix, NULL); aix_shared_fininame = concat ("_GLOBAL__AIXD_", prefix, NULL); diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index 3a816400729..453dd2515f8 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -55,7 +55,7 @@ describe_cache (struct cache_desc level1, struct cache_desc level2) snprintf (size2, sizeof (size2), "--param l2-cache-size=%u ", level2.sizekb); - return concat (size, line, size2, NULL); + return concat (size, line, size2, nullptr); } /* Detect L2 cache parameters using CPUID extended function 0x80000006. */ @@ -1215,11 +1215,11 @@ const char *host_detect_local_cpu (int argc, const char **argv) avx512vbmi2, avx512vnni, vaes, vpclmulqdq, avx512bitalg, avx512vpopcntdq, movdiri, movdir64b, waitpkg, cldemote, ptwrite, avx512bf16, enqcmd, - avx512vp2intersect, serialize, tsxldtrk, NULL); + avx512vp2intersect, serialize, tsxldtrk, nullptr); } done: - return concat (cache, "-m", argv[0], "=", cpu, options, NULL); + return concat (cache, "-m", argv[0], "=", cpu, options, nullptr); } #else diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 37aaa49996d..26c63cc86e4 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -814,7 +814,7 @@ x86_64_elf_unique_section (tree decl, int reloc) prefix to the section name. */ linkonce = one_only ? ".gnu.linkonce" : ""; - string = ACONCAT ((linkonce, prefix, ".", name, NULL)); + string = ACONCAT ((linkonce, prefix, ".", name, nullptr)); set_decl_section_name (decl, string); return; diff --git a/gcc/coverage.c b/gcc/coverage.c index 1dcda4353cd..3740b8658a8 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -1224,7 +1224,7 @@ coverage_init (const char *filename) of filename in order to prevent file path clashing. */ if (profile_data_prefix) { - filename = concat (getpwd (), separator, filename, NULL); + filename = concat (getpwd (), separator, filename, nullptr); if (profile_prefix_path) { if (!strncmp (filename, profile_prefix_path, diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 2b39a3700fc..1e999f5008c 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3709,7 +3709,7 @@ print_z_candidate (location_t loc, const char *msgstr, { const char *msg = (msgstr == NULL ? "" - : ACONCAT ((_(msgstr), " ", NULL))); + : ACONCAT ((_(msgstr), " ", nullptr))); tree fn = candidate->fn; if (flag_new_inheriting_ctors) fn = strip_inheriting_ctors (fn); @@ -4945,14 +4945,14 @@ op_error_string (const char *errmsg, int ntypes, bool match) const char *msg; const char *msgp = concat (match ? G_("ambiguous overload for ") - : G_("no match for "), errmsg, NULL); + : G_("no match for "), errmsg, nullptr); if (ntypes == 3) - msg = concat (msgp, G_(" (operand types are %qT, %qT, and %qT)"), NULL); + msg = concat (msgp, G_(" (operand types are %qT, %qT, and %qT)"), nullptr); else if (ntypes == 2) - msg = concat (msgp, G_(" (operand types are %qT and %qT)"), NULL); + msg = concat (msgp, G_(" (operand types are %qT and %qT)"), nullptr); else - msg = concat (msgp, G_(" (operand type is %qT)"), NULL); + msg = concat (msgp, G_(" (operand type is %qT)"), nullptr); return msg; } @@ -9866,7 +9866,7 @@ name_as_c_string (tree name, tree type, bool *free_p) /* For a destructor, add the '~'. */ if (IDENTIFIER_DTOR_P (name)) { - pretty_name = concat ("~", pretty_name, NULL); + pretty_name = concat ("~", pretty_name, nullptr); /* Remember that we need to free the memory allocated. */ *free_p = true; } @@ -9876,7 +9876,7 @@ name_as_c_string (tree name, tree type, bool *free_p) pretty_name = concat ("operator ", type_as_string_translate (TREE_TYPE (name), TFF_PLAIN_IDENTIFIER), - NULL); + nullptr); /* Remember that we need to free the memory allocated. */ *free_p = true; } diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c index 2a816d826a6..72acfcf810b 100644 --- a/gcc/cp/vtable-class-hierarchy.c +++ b/gcc/cp/vtable-class-hierarchy.c @@ -686,7 +686,7 @@ vtv_string_hash (const char *in) static char * get_log_file_name (const char *fname) { - const char *tmp_dir = concat (dump_dir_name, NULL); + const char *tmp_dir = concat (dump_dir_name, nullptr); char *full_name; int dir_len; int fname_len; @@ -763,7 +763,7 @@ insert_call_to_register_set (tree class_name, tree call_expr; int num_args = vtbl_ptr_array->length(); char *array_arg_name = ACONCAT (("__vptr_array_", - IDENTIFIER_POINTER (class_name), NULL)); + IDENTIFIER_POINTER (class_name), nullptr)); tree array_arg_type = build_array_type_nelts (build_pointer_type (build_pointer_type (void_type_node)), diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 5a20fdecdcc..89efea0c0da 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -1016,7 +1016,7 @@ dbxout_init (const char *input_file_name) if (cwd[0] == '\0') cwd = "/"; else if (!IS_DIR_SEPARATOR (cwd[strlen (cwd) - 1])) - cwd = concat (cwd, "/", NULL); + cwd = concat (cwd, "/", nullptr); cwd = remap_debug_filename (cwd); } #ifdef DBX_OUTPUT_MAIN_SOURCE_DIRECTORY diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 5d61946fc49..2d09234a351 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -353,10 +353,10 @@ get_dump_file_name (struct dump_file_info *dfi, int part) const { char part_id[8]; snprintf (part_id, sizeof (part_id), ".%i", part); - return concat (dump_base_name, dump_id, part_id, dfi->suffix, NULL); + return concat (dump_base_name, dump_id, part_id, dfi->suffix, nullptr); } else - return concat (dump_base_name, dump_id, dfi->suffix, NULL); + return concat (dump_base_name, dump_id, dfi->suffix, nullptr); } /* Open a dump file called FILENAME. Some filenames are special and diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 9deca031fc2..105cc10753a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11192,7 +11192,7 @@ add_skeleton_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, static void add_top_level_skeleton_die_attrs (dw_die_ref die) { - const char *dwo_file_name = concat (aux_base_name, ".dwo", NULL); + const char *dwo_file_name = concat (aux_base_name, ".dwo", nullptr); const char *comp_dir = comp_dir_string (); add_skeleton_AT_string (die, dwarf_AT (DW_AT_dwo_name), dwo_file_name); @@ -11378,7 +11378,7 @@ add_enumerator_pubname (const char *scope_name, dw_die_ref die) pubname_entry e; gcc_assert (scope_name); - e.name = concat (scope_name, get_AT_string (die, DW_AT_name), NULL); + e.name = concat (scope_name, get_AT_string (die, DW_AT_name), nullptr); e.die = die; vec_safe_push (pubname_table, e); } @@ -11407,7 +11407,7 @@ add_pubtype (tree decl, dw_die_ref die) { scope_name = lang_hooks.dwarf_name (scope, 1); if (scope_name != NULL && scope_name[0] != '\0') - scope_name = concat (scope_name, sep, NULL); + scope_name = concat (scope_name, sep, nullptr); else scope_name = ""; } @@ -11422,7 +11422,7 @@ add_pubtype (tree decl, dw_die_ref die) if (name != NULL && name[0] != '\0') { e.die = die; - e.name = concat (scope_name, name, NULL); + e.name = concat (scope_name, name, nullptr); vec_safe_push (pubtype_table, e); } @@ -23146,7 +23146,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) if (DECL_ARTIFICIAL (decl)) add_AT_flag (seg_die, DW_AT_artificial, 1); - name = concat ("__second_sect_of_", name, NULL); + name = concat ("__second_sect_of_", name, nullptr); add_AT_low_high_pc (seg_die, fde->dw_fde_second_begin, fde->dw_fde_second_end, false); add_name_attribute (seg_die, name); diff --git a/gcc/expr.c b/gcc/expr.c index 3c68b0d754c..acd607d5bc9 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -12676,7 +12676,7 @@ build_personality_function (const char *lang) gcc_unreachable (); } - name = ACONCAT (("__", lang, "_personality", unwind_and_version, NULL)); + name = ACONCAT (("__", lang, "_personality", unwind_and_version, nullptr)); type = build_function_type_list (unsigned_type_node, integer_type_node, integer_type_node, diff --git a/gcc/fold-const-call.c b/gcc/fold-const-call.c index c9e368db9d0..cac807b8d9c 100644 --- a/gcc/fold-const-call.c +++ b/gcc/fold-const-call.c @@ -163,13 +163,13 @@ do_mpfr_sincos (real_value *result_sin, real_value *result_cos, mpfr_rnd_t rnd = format->round_towards_zero ? MPFR_RNDZ : MPFR_RNDN; mpfr_t m, ms, mc; - mpfr_inits2 (prec, m, ms, mc, NULL); + mpfr_inits2 (prec, m, ms, mc, nullptr); mpfr_from_real (m, arg, MPFR_RNDN); mpfr_clear_flags (); bool inexact = mpfr_sin_cos (ms, mc, m, rnd); bool ok = (do_mpfr_ckconv (result_sin, ms, inexact, format) && do_mpfr_ckconv (result_cos, mc, inexact, format)); - mpfr_clears (m, ms, mc, NULL); + mpfr_clears (m, ms, mc, nullptr); return ok; } @@ -196,13 +196,13 @@ do_mpfr_arg2 (real_value *result, mpfr_rnd_t rnd = format->round_towards_zero ? MPFR_RNDZ : MPFR_RNDN; mpfr_t m0, m1; - mpfr_inits2 (prec, m0, m1, NULL); + mpfr_inits2 (prec, m0, m1, nullptr); mpfr_from_real (m0, arg0, MPFR_RNDN); mpfr_from_real (m1, arg1, MPFR_RNDN); mpfr_clear_flags (); bool inexact = func (m0, m0, m1, rnd); bool ok = do_mpfr_ckconv (result, m0, inexact, format); - mpfr_clears (m0, m1, NULL); + mpfr_clears (m0, m1, nullptr); return ok; } @@ -263,14 +263,14 @@ do_mpfr_arg3 (real_value *result, mpfr_rnd_t rnd = format->round_towards_zero ? MPFR_RNDZ : MPFR_RNDN; mpfr_t m0, m1, m2; - mpfr_inits2 (prec, m0, m1, m2, NULL); + mpfr_inits2 (prec, m0, m1, m2, nullptr); mpfr_from_real (m0, arg0, MPFR_RNDN); mpfr_from_real (m1, arg1, MPFR_RNDN); mpfr_from_real (m2, arg2, MPFR_RNDN); mpfr_clear_flags (); bool inexact = func (m0, m0, m1, m2, rnd); bool ok = do_mpfr_ckconv (result, m0, inexact, format); - mpfr_clears (m0, m1, m2, NULL); + mpfr_clears (m0, m1, m2, nullptr); return ok; } diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index f76e19640a3..3ddf1728f97 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -243,7 +243,7 @@ gfc_arith_init_1 (void) if (i == real_info->radix) real_info->precision++; - mpfr_clears (a, b, NULL); + mpfr_clears (a, b, nullptr); } } @@ -264,7 +264,7 @@ gfc_arith_done_1 (void) } for (rp = gfc_real_kinds; rp->kind; rp++) - mpfr_clears (rp->epsilon, rp->huge, rp->tiny, rp->subnormal, NULL); + mpfr_clears (rp->epsilon, rp->huge, rp->tiny, rp->subnormal, nullptr); mpfr_free_cache (); } diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c index dacc1d7ba51..b2c2e64314e 100644 --- a/gcc/fortran/error.c +++ b/gcc/fortran/error.c @@ -1119,7 +1119,7 @@ gfc_diagnostic_starter (diagnostic_context *context, || diagnostic_location (diagnostic, 0) == context->last_location) { pp_set_prefix (context->printer, - concat (locus_prefix, " ", kind_prefix, NULL)); + concat (locus_prefix, " ", kind_prefix, nullptr)); free (locus_prefix); if (one_locus || same_locus) @@ -1136,7 +1136,7 @@ gfc_diagnostic_starter (diagnostic_context *context, pp_newline (context->printer); locus_prefix = gfc_diagnostic_build_locus_prefix (context, s2); pp_set_prefix (context->printer, - concat (locus_prefix, " ", kind_prefix, NULL)); + concat (locus_prefix, " ", kind_prefix, nullptr)); free (kind_prefix); free (locus_prefix); } diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index eb8b2afeb29..e15907f859a 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -2841,7 +2841,7 @@ asympt_erfc_scaled (mpfr_t res, mpfr_t arg) mpfr_set (res, sum, GFC_RND_MODE); mpfr_set_default_prec (prec); - mpfr_clears (sum, x, u, v, w, oldsum, sumtrunc, NULL); + mpfr_clears (sum, x, u, v, w, oldsum, sumtrunc, nullptr); mpz_clear (num); } @@ -6999,7 +6999,7 @@ gfc_simplify_scale (gfc_expr *x, gfc_expr *i) else mpfr_mul (result->value.real, x->value.real, scale, GFC_RND_MODE); - mpfr_clears (scale, radix, NULL); + mpfr_clears (scale, radix, nullptr); return range_check (result, "SCALE"); } @@ -7279,7 +7279,7 @@ gfc_simplify_set_exponent (gfc_expr *x, gfc_expr *i) exp2 = (unsigned long) mpz_get_d (i->value.integer); mpfr_mul_2exp (result->value.real, frac, exp2, GFC_RND_MODE); - mpfr_clears (absv, log2, pow2, frac, NULL); + mpfr_clears (absv, log2, pow2, frac, nullptr); return range_check (result, "SET_EXPONENT"); } diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c index 3e1c9fe8569..28b4404c5c3 100644 --- a/gcc/gcc-ar.c +++ b/gcc/gcc-ar.c @@ -85,7 +85,7 @@ setup_prefixes (const char *exec_path) if (!self) self = exec_path; else - self = concat (self, "gcc-" PERSONALITY, NULL); + self = concat (self, "gcc-" PERSONALITY, nullptr); /* Relocate the exec prefix. */ self_exec_prefix = make_relative_prefix (self, @@ -104,18 +104,18 @@ setup_prefixes (const char *exec_path) /* Build the relative path to the target-specific tool directory. */ self_tooldir_prefix = concat (tooldir_base_prefix, target_machine, - dir_separator, NULL); + dir_separator, nullptr); self_tooldir_prefix = concat (self_exec_prefix, target_machine, dir_separator, target_version, dir_separator, - self_tooldir_prefix, NULL); + self_tooldir_prefix, nullptr); /* Add the target-specific tool bin prefix. */ - prefix_from_string (concat (self_tooldir_prefix, "bin", NULL), &target_path); + prefix_from_string (concat (self_tooldir_prefix, "bin", nullptr), &target_path); /* Add the target-specific libexec prefix. */ self_libexec_prefix = concat (self_libexec_prefix, target_machine, dir_separator, target_version, - dir_separator, NULL); + dir_separator, nullptr); prefix_from_string (self_libexec_prefix, &target_path); /* Add path as a last resort. */ @@ -171,7 +171,7 @@ main (int ac, char **av) if (end > arg && !IS_DIR_SEPARATOR (*end)) { static const char dir_separator_str[] = { DIR_SEPARATOR, 0 }; - arg = concat (arg, dir_separator_str, NULL); + arg = concat (arg, dir_separator_str, nullptr); } add_prefix_begin (&path, arg); @@ -214,7 +214,7 @@ main (int ac, char **av) nargv[1] = "--plugin"; nargv[2] = plugin; if (is_ar && av[1] && av[1][0] != '-') - av[1] = concat ("-", av[1], NULL); + av[1] = concat ("-", av[1], nullptr); for (k = 1; k < ac; k++) nargv[2 + k] = av[k]; nargv[2 + k] = NULL; @@ -231,7 +231,7 @@ main (int ac, char **av) err_msg = pex_one (PEX_LAST|PEX_SEARCH, exe_name, CONST_CAST2 (char * const *, const char **, nargv), - concat ("gcc-", exe_name, NULL), + concat ("gcc-", exe_name, nullptr), NULL,NULL, &status, &err); if (err_msg) fprintf (stderr, "Error running %s: %s\n", exe_name, err_msg); diff --git a/gcc/gcc.c b/gcc/gcc.c index c0eb3c10cfd..3af08859aee 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1740,7 +1740,7 @@ init_gcc_specs (struct obstack *obstack, const char *shared_name, "%{shared:", shared_name, "}" #endif #endif - "}}", NULL); + "}}", nullptr); obstack_grow (obstack, buf, strlen (buf)); free (buf); @@ -1955,7 +1955,7 @@ set_spec (const char *name, const char *spec, bool user_p) old_spec = *(sl->ptr_spec); *(sl->ptr_spec) = ((spec[0] == '+' && ISSPACE ((unsigned char)spec[1])) - ? concat (old_spec, spec + 1, NULL) + ? concat (old_spec, spec + 1, nullptr) : xstrdup (spec)); #ifdef DEBUG_SPECS @@ -2089,7 +2089,7 @@ close_at_file (void) char **argv = (char **) alloca (sizeof (char *) * (n_args + 1)); char *temp_file = make_temp_file (""); - char *at_argument = concat ("@", temp_file, NULL); + char *at_argument = concat ("@", temp_file, nullptr); FILE *f = fopen (temp_file, "w"); int status; unsigned int i; @@ -2623,14 +2623,14 @@ for_each_path (const struct path_prefix *paths, just_multi_suffix = just_machine_suffix; if (do_multi && multilib_dir && strcmp (multilib_dir, ".") != 0) { - multi_dir = concat (multilib_dir, dir_separator_str, NULL); - multi_suffix = concat (multi_suffix, multi_dir, NULL); - just_multi_suffix = concat (just_multi_suffix, multi_dir, NULL); + multi_dir = concat (multilib_dir, dir_separator_str, nullptr); + multi_suffix = concat (multi_suffix, multi_dir, nullptr); + just_multi_suffix = concat (just_multi_suffix, multi_dir, nullptr); } if (do_multi && multilib_os_dir && strcmp (multilib_os_dir, ".") != 0) - multi_os_dir = concat (multilib_os_dir, dir_separator_str, NULL); + multi_os_dir = concat (multilib_os_dir, dir_separator_str, nullptr); if (multiarch_dir) - multiarch_suffix = concat (multiarch_dir, dir_separator_str, NULL); + multiarch_suffix = concat (multiarch_dir, dir_separator_str, nullptr); while (1) { @@ -3004,9 +3004,9 @@ add_sysrooted_prefix (struct path_prefix *pprefix, const char *prefix, if (target_sysroot_suffix) prefix = concat (sysroot_no_trailing_dir_separator, - target_sysroot_suffix, prefix, NULL); + target_sysroot_suffix, prefix, nullptr); else - prefix = concat (sysroot_no_trailing_dir_separator, prefix, NULL); + prefix = concat (sysroot_no_trailing_dir_separator, prefix, nullptr); free (sysroot_no_trailing_dir_separator); @@ -3041,9 +3041,9 @@ add_sysrooted_hdrs_prefix (struct path_prefix *pprefix, const char *prefix, if (target_sysroot_hdrs_suffix) prefix = concat (sysroot_no_trailing_dir_separator, - target_sysroot_hdrs_suffix, prefix, NULL); + target_sysroot_hdrs_suffix, prefix, nullptr); else - prefix = concat (sysroot_no_trailing_dir_separator, prefix, NULL); + prefix = concat (sysroot_no_trailing_dir_separator, prefix, nullptr); free (sysroot_no_trailing_dir_separator); @@ -4482,7 +4482,7 @@ process_command (unsigned int decoded_options_count, standard_bindir_prefix, standard_libexec_prefix); if (gcc_exec_prefix) - xputenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, NULL)); + xputenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, nullptr)); } else { @@ -4490,7 +4490,7 @@ process_command (unsigned int decoded_options_count, GCC_EXEC_PREFIX is typically a directory name with a trailing / (which is ignored by make_relative_prefix), so append a program name. */ - char *tmp_prefix = concat (gcc_exec_prefix, "gcc", NULL); + char *tmp_prefix = concat (gcc_exec_prefix, "gcc", nullptr); gcc_libexec_prefix = get_relative_prefix (tmp_prefix, standard_exec_prefix, standard_libexec_prefix); @@ -4550,7 +4550,7 @@ process_command (unsigned int decoded_options_count, { strncpy (nstore, startp, endp - startp); if (endp == startp) - strcpy (nstore, concat (".", dir_separator_str, NULL)); + strcpy (nstore, concat (".", dir_separator_str, nullptr)); else if (!IS_DIR_SEPARATOR (endp[-1])) { nstore[endp - startp] = DIR_SEPARATOR; @@ -4584,7 +4584,7 @@ process_command (unsigned int decoded_options_count, { strncpy (nstore, startp, endp - startp); if (endp == startp) - strcpy (nstore, concat (".", dir_separator_str, NULL)); + strcpy (nstore, concat (".", dir_separator_str, nullptr)); else if (!IS_DIR_SEPARATOR (endp[-1])) { nstore[endp - startp] = DIR_SEPARATOR; @@ -4617,7 +4617,7 @@ process_command (unsigned int decoded_options_count, { strncpy (nstore, startp, endp - startp); if (endp == startp) - strcpy (nstore, concat (".", dir_separator_str, NULL)); + strcpy (nstore, concat (".", dir_separator_str, nullptr)); else if (!IS_DIR_SEPARATOR (endp[-1])) { nstore[endp - startp] = DIR_SEPARATOR; @@ -4929,9 +4929,9 @@ process_command (unsigned int decoded_options_count, dumpbase[strlen (dumpbase) - strlen (dumpbase_ext)] = '\0'; if (dumpdir) - prefix = concat (dumpdir, dumpbase, "-", NULL); + prefix = concat (dumpdir, dumpbase, "-", nullptr); else - prefix = concat (dumpbase, "-", NULL); + prefix = concat (dumpbase, "-", nullptr); free (dumpdir); free (dumpbase); @@ -5013,12 +5013,12 @@ process_command (unsigned int decoded_options_count, { if (dumpdir) { - char *p = concat (dumpdir, obase, "-", NULL); + char *p = concat (dumpdir, obase, "-", nullptr); free (dumpdir); dumpdir = p; } else - dumpdir = concat (obase, "-", NULL); + dumpdir = concat (obase, "-", nullptr); dumpdir_trailing_dash_added = true; @@ -5148,21 +5148,21 @@ process_command (unsigned int decoded_options_count, gcc_assert (!IS_ABSOLUTE_PATH (tooldir_base_prefix)); tooldir_prefix2 = concat (tooldir_base_prefix, spec_machine, - dir_separator_str, NULL); + dir_separator_str, nullptr); /* Look for tools relative to the location from which the driver is running, or, if that is not available, the configured prefix. */ tooldir_prefix = concat (gcc_exec_prefix ? gcc_exec_prefix : standard_exec_prefix, spec_host_machine, dir_separator_str, spec_version, - accel_dir_suffix, dir_separator_str, tooldir_prefix2, NULL); + accel_dir_suffix, dir_separator_str, tooldir_prefix2, nullptr); free (tooldir_prefix2); add_prefix (&exec_prefixes, - concat (tooldir_prefix, "bin", dir_separator_str, NULL), + concat (tooldir_prefix, "bin", dir_separator_str, nullptr), "BINUTILS", PREFIX_PRIORITY_LAST, 0, 0); add_prefix (&startfile_prefixes, - concat (tooldir_prefix, "lib", dir_separator_str, NULL), + concat (tooldir_prefix, "lib", dir_separator_str, nullptr), "BINUTILS", PREFIX_PRIORITY_LAST, 0, 1); free (tooldir_prefix); @@ -5194,7 +5194,7 @@ process_command (unsigned int decoded_options_count, environment variable. */ if (compare_debug == 2 || compare_debug == 3) { - const char *opt = concat ("-fcompare-debug=", compare_debug_opt, NULL); + const char *opt = concat ("-fcompare-debug=", compare_debug_opt, nullptr); save_switch (opt, 0, NULL, false, true); compare_debug = 1; } @@ -6004,7 +6004,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) if (compare_debug < 0) { - suffix = concat (".gk", suffix, NULL); + suffix = concat (".gk", suffix, nullptr); suffix_length += 3; } @@ -6216,7 +6216,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) info.append = "include-fixed"; if (*sysroot_hdrs_suffix_spec) info.append = concat (info.append, dir_separator_str, - multilib_dir, NULL); + multilib_dir, nullptr); info.append_len = strlen (info.append); for_each_path (&include_prefixes, false, info.append_len, spec_path, &info); @@ -8086,8 +8086,8 @@ driver::set_up_specs () const /* Read specs from a file if there is one. */ machine_suffix = concat (spec_host_machine, dir_separator_str, spec_version, - accel_dir_suffix, dir_separator_str, NULL); - just_machine_suffix = concat (spec_machine, dir_separator_str, NULL); + accel_dir_suffix, dir_separator_str, nullptr); + just_machine_suffix = concat (spec_machine, dir_separator_str, nullptr); specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, true); /* Read the specs file unless it is a default one. */ @@ -8212,7 +8212,7 @@ driver::set_up_specs () const concat (gcc_exec_prefix ? gcc_exec_prefix : standard_exec_prefix, machine_suffix, - standard_startfile_prefix, NULL), + standard_startfile_prefix, nullptr), NULL, PREFIX_PRIORITY_LAST, 0, 1); } @@ -8293,7 +8293,7 @@ driver::set_up_specs () const if (gcc_exec_prefix) gcc_exec_prefix = concat (gcc_exec_prefix, spec_host_machine, dir_separator_str, spec_version, - accel_dir_suffix, dir_separator_str, NULL); + accel_dir_suffix, dir_separator_str, nullptr); /* Now we have the specs. Set the `valid' bits for switches that match anything in any spec. */ @@ -8437,7 +8437,7 @@ driver::maybe_print_and_exit () const return (0); } #endif - print_prog_name = concat (print_prog_name, use_ld, NULL); + print_prog_name = concat (print_prog_name, use_ld, nullptr); } char *newname = find_a_file (&exec_prefixes, print_prog_name, X_OK, 0); printf ("%s\n", (newname ? newname : print_prog_name)); @@ -8792,11 +8792,11 @@ driver::maybe_run_linker (const char *argv0) const { char *tofree = dumpdir; gcc_checking_assert (strlen (dumpdir) == dumpdir_length); - dumpdir = concat (dumpdir, outbase, ".", NULL); + dumpdir = concat (dumpdir, outbase, ".", nullptr); free (tofree); } else - dumpdir = concat (outbase, ".", NULL); + dumpdir = concat (outbase, ".", nullptr); dumpdir_length += strlen (outbase) + 1; dumpdir_trailing_dash_added = true; } @@ -8948,7 +8948,7 @@ driver::detect_jobserver () const const char *space = strchr (makeflags + offset, ' '); if (space != NULL) strcpy (dup + offset, space); - xputenv (concat ("MAKEFLAGS=", dup, NULL)); + xputenv (concat ("MAKEFLAGS=", dup, nullptr)); } } } @@ -9482,7 +9482,7 @@ set_multilib_dir (void) /* Append multilib reuse rules if any. With those rules, we can reuse one multilib for certain different options sets. */ if (strlen (multilib_reuse) > 0) - p = concat (p, multilib_reuse, NULL); + p = concat (p, multilib_reuse, nullptr); while (*p != '\0') { @@ -10218,7 +10218,7 @@ find_plugindir_spec_function (int argc, const char **argv ATTRIBUTE_UNUSED) if (argc != 0) abort (); - option = concat ("-iplugindir=", find_file ("plugin"), NULL); + option = concat ("-iplugindir=", find_file ("plugin"), nullptr); return option; } @@ -10318,7 +10318,7 @@ compare_debug_dump_opt_spec_function (int arg, name = xstrdup (argbuf.last ()); char *arg = quote_spec (xstrdup (name)); - ret = concat ("-fdump-final-insns=", arg, NULL); + ret = concat ("-fdump-final-insns=", arg, nullptr); free (arg); } @@ -10336,7 +10336,7 @@ compare_debug_dump_opt_spec_function (int arg, { char *tmp = ret; ret = concat ("%{!frandom-seed=*:-frandom-seed=", random_seed, "} ", - ret, NULL); + ret, nullptr); free (tmp); } @@ -10365,7 +10365,7 @@ compare_debug_self_opt_spec_function (int arg, %<o %<MD %<MMD %<MF* %<MG %<MP %<MQ* %<MT* \ %<fdump-final-insns=* -w -S -o %j \ %{!fcompare-debug-second:-fcompare-debug-second} \ -", compare_debug_opt, NULL); +", compare_debug_opt, nullptr); } /* %:pass-through-libs spec function. Finds all -l options and input @@ -10398,12 +10398,12 @@ pass_through_libs_spec_func (int argc, const char **argv) else if (!*lopt) lopt = argv[n]; prepended = concat (prepended, "-plugin-opt=-pass-through=-l", - lopt, " ", NULL); + lopt, " ", nullptr); } else if (!strcmp (".a", argv[n] + strlen (argv[n]) - 2)) { prepended = concat (prepended, "-plugin-opt=-pass-through=", - argv[n], " ", NULL); + argv[n], " ", nullptr); } if (prepended != old) free (old); @@ -10448,7 +10448,7 @@ dumps_spec_func (int argc, const char **argv ATTRIBUTE_UNUSED) if (dumpdir) { p = quote_spec_arg (xstrdup (dumpdir)); - args[nargs++] = concat (" -dumpdir ", p, NULL); + args[nargs++] = concat (" -dumpdir ", p, nullptr); free (p); } @@ -10488,24 +10488,24 @@ dumps_spec_func (int argc, const char **argv ATTRIBUTE_UNUSED) else gk = ""; - p = concat (base, gk, ext, NULL); + p = concat (base, gk, ext, nullptr); free (base); base = p; } base = quote_spec_arg (base); - args[nargs++] = concat (" -dumpbase ", base, NULL); + args[nargs++] = concat (" -dumpbase ", base, nullptr); free (base); if (*ext) { p = quote_spec_arg (xstrdup (ext)); - args[nargs++] = concat (" -dumpbase-ext ", p, NULL); + args[nargs++] = concat (" -dumpbase-ext ", p, nullptr); free (p); } - const char *ret = concat (args[0], args[1], args[2], NULL); + const char *ret = concat (args[0], args[1], args[2], nullptr); while (nargs > 0) free (args[--nargs]); @@ -10603,12 +10603,12 @@ find_fortran_preinclude_file (int argc, const char **argv) const char *path = find_a_file (&include_prefixes, argv[1], R_OK, false); if (path != NULL) - result = concat (argv[0], path, NULL); + result = concat (argv[0], path, nullptr); else { path = find_a_file (&prefixes, argv[1], R_OK, false); if (path != NULL) - result = concat (argv[0], path, NULL); + result = concat (argv[0], path, nullptr); } path_prefix_reset (&prefixes); diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 6166c75a9b1..ec77626a196 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -1979,7 +1979,7 @@ evaluate_eq_attr (rtx exp, class attr_desc *attr, rtx value, gcc_assert (GET_CODE (exp) == EQ_ATTR); prefix = attr->enum_name ? attr->enum_name : attr->name; - string = ACONCAT ((prefix, "_", XSTR (exp, 1), NULL)); + string = ACONCAT ((prefix, "_", XSTR (exp, 1), nullptr)); for (p = string; *p; p++) *p = TOUPPER (*p); diff --git a/gcc/gencfn-macros.c b/gcc/gencfn-macros.c index 74f0e7e1a37..bb573849b93 100644 --- a/gcc/gencfn-macros.c +++ b/gcc/gencfn-macros.c @@ -87,7 +87,7 @@ static bool is_group (string_set *builtins, const char *name, const char *const *suffixes) { for (unsigned int i = 0; suffixes[i]; ++i) - if (!builtins->contains (ACONCAT (("BUILT_IN_", name, suffixes[i], NULL)))) + if (!builtins->contains (ACONCAT (("BUILT_IN_", name, suffixes[i], nullptr)))) return false; return true; } diff --git a/gcc/genconstants.c b/gcc/genconstants.c index af348569888..97c8aba3029 100644 --- a/gcc/genconstants.c +++ b/gcc/genconstants.c @@ -66,7 +66,7 @@ print_enum_type (void **slot, void *info ATTRIBUTE_UNUSED) printf ("\n};\n"); /* Define NUM_<enum>_VALUES to be the largest enum value + 1. */ - value_name = ACONCAT (("num_", def->name, "_values", NULL)); + value_name = ACONCAT (("num_", def->name, "_values", nullptr)); upcase_string (value_name); printf ("#define %s %d\n", value_name, def->num_values); diff --git a/gcc/gengtype-state.c b/gcc/gengtype-state.c index d1d54e9de7d..7c3f345e74e 100644 --- a/gcc/gengtype-state.c +++ b/gcc/gengtype-state.c @@ -1342,7 +1342,7 @@ write_state (const char *state_path) memset (tempsuffix, 0, sizeof (tempsuffix)); snprintf (tempsuffix, sizeof (tempsuffix) - 1, "-%ld-%d.tmp", (long) now, (int) getpid ()); - temp_state_path = concat (state_path, tempsuffix, NULL); + temp_state_path = concat (state_path, tempsuffix, nullptr); state_file = fopen (temp_state_path, "w"); if (state_file == NULL) fatal ("Failed to open file %s for writing state: %s", @@ -1920,7 +1920,7 @@ read_state_fileloc (struct fileloc *floc) if (issrcfile) { static const char dirsepstr[2] = { DIR_SEPARATOR, (char) 0 }; - char *fullpath = concat (srcdir, dirsepstr, path, NULL); + char *fullpath = concat (srcdir, dirsepstr, path, nullptr); floc->file = input_file_by_name (fullpath); free (fullpath); } diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 981577481af..a367bc8a580 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -2352,7 +2352,7 @@ close_output_files (void) if (backup_dir) { backupname = concat (backup_dir, "/", - lbasename (of->name), "~", NULL); + lbasename (of->name), "~", nullptr); if (!access (of->name, F_OK) && rename (of->name, backupname)) fatal ("failed to back up %s as %s: %s", of->name, backupname, xstrerror (errno)); @@ -4260,14 +4260,14 @@ write_field_root (outf_p f, pair_p v, type_p type, const char *name, { newv = *v; newv.type = field_type; - newv.name = ACONCAT ((v->name, ".", field_name, NULL)); + newv.name = ACONCAT ((v->name, ".", field_name, nullptr)); v = &newv; } /* Otherwise, any arrays nested in the structure are too complex to handle. */ else if (field_type->kind == TYPE_ARRAY) v = NULL; - write_root (f, v, field_type, ACONCAT ((name, ".", field_name, NULL)), + write_root (f, v, field_type, ACONCAT ((name, ".", field_name, nullptr)), has_length, line, emit_pch); } @@ -4339,7 +4339,7 @@ write_root (outf_p f, pair_p v, type_p type, const char *name, int has_length, write_field_root (f, v, type, name, 0, line, emit_pch, validf->type, ACONCAT ((fld->name, ".", - validf->name, NULL))); + validf->name, nullptr))); } else if (desc) error_at_line (line, diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 0a8cba62e0c..ea91630deb1 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -601,16 +601,16 @@ get_operator (const char *id, bool allow_null = false) if (all_lower) { /* Try in caps with _EXPR appended. */ - id2 = ACONCAT ((id, "_EXPR", NULL)); + id2 = ACONCAT ((id, "_EXPR", nullptr)); for (unsigned int i = 0; id2[i]; ++i) id2[i] = TOUPPER (id2[i]); } else if (all_upper && strncmp (id, "IFN_", 4) == 0) /* Try CFN_ instead of IFN_. */ - id2 = ACONCAT (("CFN_", id + 4, NULL)); + id2 = ACONCAT (("CFN_", id + 4, nullptr)); else if (all_upper && strncmp (id, "BUILT_IN_", 9) == 0) /* Try prepending CFN_. */ - id2 = ACONCAT (("CFN_", id, NULL)); + id2 = ACONCAT (("CFN_", id, nullptr)); else return NULL; diff --git a/gcc/hsa-brig.c b/gcc/hsa-brig.c index 545385fd4aa..379ab162a22 100644 --- a/gcc/hsa-brig.c +++ b/gcc/hsa-brig.c @@ -487,7 +487,7 @@ brig_init (void) part = main_input_filename; else part++; - modname = concat ("&__hsa_module_", part, NULL); + modname = concat ("&__hsa_module_", part, nullptr); char *extension = strchr (modname, '.'); if (extension) *extension = '\0'; diff --git a/gcc/incpath.c b/gcc/incpath.c index 8a2bda00f80..1c1aaa8f297 100644 --- a/gcc/incpath.c +++ b/gcc/incpath.c @@ -149,7 +149,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, char *str = concat (iprefix, p->fname + len, NULL); if (p->multilib == 1 && imultilib) str = reconcat (str, str, dir_separator_str, - imultilib, NULL); + imultilib, nullptr); else if (p->multilib == 2) { if (!imultiarch) @@ -158,7 +158,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, continue; } str = reconcat (str, str, dir_separator_str, - imultiarch, NULL); + imultiarch, nullptr); } add_path (str, INC_SYSTEM, p->cxx_aware, false); } @@ -180,7 +180,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, if (sysroot_len > 0 && sysroot[sysroot_len - 1] == DIR_SEPARATOR) sysroot_no_trailing_dir_separator[sysroot_len - 1] = '\0'; - str = concat (sysroot_no_trailing_dir_separator, p->fname, NULL); + str = concat (sysroot_no_trailing_dir_separator, p->fname, nullptr); free (sysroot_no_trailing_dir_separator); } else if (!p->add_sysroot && relocated @@ -198,7 +198,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, char *dummy; /* Make relative prefix expects the first argument to be a program, not a directory. */ - dummy = concat (gcc_exec_prefix, "dummy", NULL); + dummy = concat (gcc_exec_prefix, "dummy", nullptr); relocated_prefix = make_relative_prefix (dummy, cpp_EXEC_PREFIX, @@ -215,7 +215,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, str = update_path (p->fname, p->component); if (p->multilib == 1 && imultilib) - str = reconcat (str, str, dir_separator_str, imultilib, NULL); + str = reconcat (str, str, dir_separator_str, imultilib, nullptr); else if (p->multilib == 2) { if (!imultiarch) @@ -223,7 +223,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, free (str); continue; } - str = reconcat (str, str, dir_separator_str, imultiarch, NULL); + str = reconcat (str, str, dir_separator_str, imultiarch, nullptr); } add_path (str, INC_SYSTEM, p->cxx_aware, false); @@ -327,7 +327,7 @@ add_sysroot_to_chain (const char *sysroot, int chain) if (p->user_supplied_p) { if (p->name[0] == '=') - p->name = concat (sysroot, p->name + 1, NULL); + p->name = concat (sysroot, p->name + 1, nullptr); if (strncmp (p->name, "$SYSROOT", strlen ("$SYSROOT")) == 0) p->name = concat (sysroot, p->name + strlen ("$SYSROOT"), NULL); } diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c index 7d0fd3924c0..f0eb093d840 100644 --- a/gcc/lto-streamer.c +++ b/gcc/lto-streamer.c @@ -138,7 +138,7 @@ lto_get_section_name (int section_type, const char *name, sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, f->id); else sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, get_random_seed (false)); - return concat (section_name_prefix, sep, add, post, NULL); + return concat (section_name_prefix, sep, add, post, nullptr); } diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index 939a83ac73a..29b00b30468 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -1116,7 +1116,7 @@ debug_objcopy (const char *infile, bool rename) } if (save_temps) - outfile = concat (orig_infile, ".debug.temp.o", NULL); + outfile = concat (orig_infile, ".debug.temp.o", nullptr); else outfile = make_temp_file (".debug.temp.o"); errmsg = simple_object_copy_lto_debug_sections (inobj, outfile, &err, rename); @@ -1336,7 +1336,7 @@ run_gcc (unsigned argc, char *argv[]) char *xassembler_opts_string = XOBFINISH (&temporary_obstack, char *); collect_gcc_options = concat (collect_gcc_options, xassembler_opts_string, - NULL); + nullptr); } get_options_from_collect_gcc_options (collect_gcc, collect_gcc_options, @@ -1532,7 +1532,7 @@ run_gcc (unsigned argc, char *argv[]) dumppfx = xstrndup (linker_output, obase - linker_output + blen - xlen + 1); else - dumppfx = concat (linker_output, ".", NULL); + dumppfx = concat (linker_output, ".", nullptr); } } @@ -1540,7 +1540,7 @@ run_gcc (unsigned argc, char *argv[]) that, when it is used as -dumpbase, it overrides any occurrence of -dumpdir that might have been passed in. */ if (!dumppfx || lbasename (dumppfx) == dumppfx) - dumppfx = concat (current_dir, dumppfx, NULL); + dumppfx = concat (current_dir, dumppfx, nullptr); /* Make sure some -dumpdir is passed, so as to get predictable -dumpbase overriding semantics. If we got an incoming -dumpdir @@ -1658,7 +1658,7 @@ cont1: if (lto_mode == LTO_MODE_LTO) { /* -dumpbase argument for LTO. */ - flto_out = concat (dumppfx, "lto.o", NULL); + flto_out = concat (dumppfx, "lto.o", nullptr); obstack_ptr_grow (&argv_obstack, flto_out); if (!save_temps) @@ -1671,14 +1671,14 @@ cont1: const char *list_option = "-fltrans-output-list="; /* -dumpbase argument for WPA. */ - char *dumpbase = concat (dumppfx, "wpa", NULL); + char *dumpbase = concat (dumppfx, "wpa", nullptr); obstack_ptr_grow (&argv_obstack, dumpbase); if (save_temps) - ltrans_output_file = concat (dumppfx, "ltrans.out", NULL); + ltrans_output_file = concat (dumppfx, "ltrans.out", nullptr); else ltrans_output_file = make_temp_file (".ltrans.out"); - list_option_full = concat (list_option, ltrans_output_file, NULL); + list_option_full = concat (list_option, ltrans_output_file, nullptr); obstack_ptr_grow (&argv_obstack, list_option_full); if (jobserver) diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 54af1cff533..03b597a71bb 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -455,7 +455,7 @@ objc_write_global_declarations (void) /* If gen_declaration desired, open the output file. */ if (flag_gen_declaration) { - char * const dumpname = concat (dump_base_name, ".decl", NULL); + char * const dumpname = concat (dump_base_name, ".decl", nullptr); gen_declaration_file = fopen (dumpname, "w"); if (gen_declaration_file == 0) fatal_error (input_location, "cannot open %s: %m", dumpname); diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 8bfdfbc4432..81155ce1d4f 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -9417,7 +9417,7 @@ lower_omp_critical (gimple_stmt_iterator *gsi_p, omp_context *ctx) decl = create_tmp_var_raw (ptr_type_node); new_str = ACONCAT ((".gomp_critical_user_", - IDENTIFIER_POINTER (name), NULL)); + IDENTIFIER_POINTER (name), nullptr)); DECL_NAME (decl) = get_identifier (new_str); TREE_PUBLIC (decl) = 1; TREE_STATIC (decl) = 1; diff --git a/gcc/opt-suggestions.c b/gcc/opt-suggestions.c index 833c8c902bd..e312cf4ca29 100644 --- a/gcc/opt-suggestions.c +++ b/gcc/opt-suggestions.c @@ -113,7 +113,7 @@ option_proposer::build_option_suggestions (const char *prefix) const struct cl_enum *e = &cl_enums[option->var_enum]; for (unsigned j = 0; e->values[j].arg != NULL; j++) { - char *with_arg = concat (opt_text, e->values[j].arg, NULL); + char *with_arg = concat (opt_text, e->values[j].arg, nullptr); add_misspelling_candidates (m_option_suggestions, option, with_arg); free (with_arg); @@ -183,7 +183,7 @@ option_proposer::build_option_suggestions (const char *prefix) /* Get one arg at a time e.g. "-fsanitize=address". */ char *with_arg = concat (opt_text, sanitizer_opts[j].name, - NULL); + nullptr); /* Add with_arg and all of its variant spellings e.g. "-fno-sanitize=address" to candidates (albeit without leading dashes). */ diff --git a/gcc/optinfo-emit-json.cc b/gcc/optinfo-emit-json.cc index 6765c7d82ad..7183c5f852d 100644 --- a/gcc/optinfo-emit-json.cc +++ b/gcc/optinfo-emit-json.cc @@ -106,7 +106,7 @@ optrecord_json_writer::write () const m_root_tuple->print (&pp); bool emitted_error = false; - char *filename = concat (dump_base_name, ".opt-record.json.gz", NULL); + char *filename = concat (dump_base_name, ".opt-record.json.gz", nullptr); gzFile outfile = gzopen (filename, "w"); if (outfile == NULL) { diff --git a/gcc/opts.c b/gcc/opts.c index 340d99434b3..0ad3610219e 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1477,7 +1477,7 @@ print_filtered_help (unsigned int include_flags, char b[128]; snprintf (b, sizeof (b), "<%d,%d>", option->range_min, option->range_max); - opt = concat (opt, b, NULL); + opt = concat (opt, b, nullptr); len += strlen (b); } @@ -3082,7 +3082,7 @@ option_name (diagnostic_context *context, int option_index, return concat (cl_options[OPT_Werror_].opt_text, /* Skip over "-W". */ cl_options[option_index].opt_text + 2, - NULL); + nullptr); /* A warning with option. */ else return xstrdup (cl_options[option_index].opt_text); @@ -3142,7 +3142,7 @@ get_option_url (diagnostic_context *, int option_index) <a name="index-Wformat"></a>, and thus an id within the URL of "#index-Wformat". */ "#index", cl_options[option_index].opt_text, - NULL); + nullptr); else return NULL; } diff --git a/gcc/passes.c b/gcc/passes.c index 07b2613ffea..201e9eed675 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -797,7 +797,7 @@ pass_manager::register_one_dump_file (opt_pass *pass) to mark the start of the following dump file name / option string. */ name = strchr (pass->name, ' '); name = name ? name + 1 : pass->name; - dot_name = concat (".", name, num, NULL); + dot_name = concat (".", name, num, nullptr); if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS) { prefix = "ipa-"; @@ -815,8 +815,8 @@ pass_manager::register_one_dump_file (opt_pass *pass) dkind = DK_rtl; } - flag_name = concat (prefix, name, num, NULL); - glob_name = concat (prefix, name, NULL); + flag_name = concat (prefix, name, num, nullptr); + glob_name = concat (prefix, name, nullptr); optgroup_flags |= pass->optinfo_flags; /* For any passes that do not have an optgroup set, and which are not IPA passes setup above, set the optgroup to OPTGROUP_OTHER so that @@ -827,7 +827,7 @@ pass_manager::register_one_dump_file (opt_pass *pass) optgroup_flags, true); set_pass_for_id (id, pass); - full_name = concat (prefix, pass->name, num, NULL); + full_name = concat (prefix, pass->name, num, nullptr); register_pass_name (pass, full_name); free (CONST_CAST (char *, full_name)); } diff --git a/gcc/plugin.c b/gcc/plugin.c index 69b6f5b8b6a..55fe95be8fb 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -205,7 +205,7 @@ add_new_plugin (const char* plugin_name) #endif plugin_name = concat (default_plugin_dir_name (), "/", - plugin_name, plugin_ext, NULL); + plugin_name, plugin_ext, nullptr); if (access (plugin_name, R_OK)) fatal_error (input_location, diff --git a/gcc/prefix.c b/gcc/prefix.c index 1a403e535bd..b9a870ba297 100644 --- a/gcc/prefix.c +++ b/gcc/prefix.c @@ -97,7 +97,7 @@ get_key_value (char *key) #endif if (prefix == 0) - prefix = getenv (temp = concat (key, "_ROOT", NULL)); + prefix = getenv (temp = concat (key, "_ROOT", nullptr)); if (prefix == 0) prefix = std_prefix; @@ -220,7 +220,7 @@ translate_name (char *name) together. */ old_name = name; - name = concat (prefix, &name[keylen + 1], NULL); + name = concat (prefix, &name[keylen + 1], nullptr); free (old_name); } @@ -258,11 +258,11 @@ update_path (const char *path, const char *key) if (key[0] != '$') { - key = concat ("@", key, NULL); + key = concat ("@", key, nullptr); free_key = true; } - result = concat (key, &path[len], NULL); + result = concat (key, &path[len], nullptr); if (free_key) free (CONST_CAST (char *, key)); result = translate_name (result); diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 2a9c98ea7a0..d8ac43c7de9 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -1071,7 +1071,7 @@ print_decl_identifier (FILE *file, tree decl, int flags) have symbols with the same assembler name and DECL_SOURCE_FILE. That's why we use the name of the top-level source file of the compilation unit. ??? Unnecessary for Ada. */ - name = ACONCAT ((main_input_filename, ":", name, NULL)); + name = ACONCAT ((main_input_filename, ":", name, nullptr)); } else if (flags & PRINT_DECL_NAME) { diff --git a/gcc/read-md.c b/gcc/read-md.c index 40690a86dbc..147162f3433 100644 --- a/gcc/read-md.c +++ b/gcc/read-md.c @@ -155,7 +155,7 @@ md_reader::join_c_conditions (const char *cond1, const char *cond2) if (strcmp (cond1, cond2) == 0) return cond1; - result = concat ("(", cond1, ") && (", cond2, ")", NULL); + result = concat ("(", cond1, ") && (", cond2, ")", nullptr); obstack_ptr_grow (&m_joined_conditions_obstack, result); obstack_ptr_grow (&m_joined_conditions_obstack, cond1); obstack_ptr_grow (&m_joined_conditions_obstack, cond2); @@ -944,7 +944,7 @@ md_reader::handle_enum (file_location loc, bool md_p) ev->next = 0; if (md_p) { - value_name = concat (def->name, "_", name.string, NULL); + value_name = concat (def->name, "_", name.string, nullptr); upcase_string (value_name); ev->name = xstrdup (name.string); } @@ -1069,7 +1069,7 @@ md_reader::handle_include (file_location loc) { static const char sep[2] = { DIR_SEPARATOR, '\0' }; - pathname = concat (stackp->fname, sep, filename, NULL); + pathname = concat (stackp->fname, sep, filename, nullptr); input_file = fopen (pathname, "r"); if (input_file != NULL) break; @@ -1082,7 +1082,7 @@ md_reader::handle_include (file_location loc) if (input_file == NULL) { if (m_base_dir) - pathname = concat (m_base_dir, filename, NULL); + pathname = concat (m_base_dir, filename, nullptr); else pathname = xstrdup (filename); input_file = fopen (pathname, "r"); diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c index d5f2b11b4af..f0b5273222b 100644 --- a/gcc/read-rtl.c +++ b/gcc/read-rtl.c @@ -175,7 +175,7 @@ apply_mode_iterator (rtx x, unsigned int, int mode) static const char * get_mode_token (int mode) { - return concat ("E_", GET_MODE_NAME (mode), "mode", NULL); + return concat ("E_", GET_MODE_NAME (mode), "mode", nullptr); } /* In compact dumps, the code of insns is prefixed with "c", giving "cinsn", diff --git a/gcc/real.c b/gcc/real.c index 09ec5c08c38..f8d01cf3192 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -5544,7 +5544,7 @@ build_sinatan_real (REAL_VALUE_TYPE * r, tree type) real_maxval (&maxval, 0, mode); - mpfr_inits (mpfr_const1, mpfr_c, mpfr_maxval, NULL); + mpfr_inits (mpfr_const1, mpfr_c, mpfr_maxval, nullptr); mpfr_from_real (mpfr_const1, &dconst1, MPFR_RNDN); mpfr_from_real (mpfr_maxval, &maxval, MPFR_RNDN); @@ -5554,5 +5554,5 @@ build_sinatan_real (REAL_VALUE_TYPE * r, tree type) real_from_mpfr (r, mpfr_c, fmt, MPFR_RNDZ); - mpfr_clears (mpfr_const1, mpfr_c, mpfr_maxval, NULL); + mpfr_clears (mpfr_const1, mpfr_c, mpfr_maxval, nullptr); } diff --git a/gcc/selftest.c b/gcc/selftest.c index f9368fab49f..b9963611392 100644 --- a/gcc/selftest.c +++ b/gcc/selftest.c @@ -271,7 +271,7 @@ char * locate_file (const char *name) { ASSERT_NE (NULL, path_to_selftest_files); - return concat (path_to_selftest_files, "/", name, NULL); + return concat (path_to_selftest_files, "/", name, nullptr); } /* selftest::test_runner's ctor. */ diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 0113c7b0ce2..6af20804012 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -383,7 +383,7 @@ default_mangle_assembler_name (const char *name ATTRIBUTE_UNUSED) const char *skipped = name + (*name == '*' ? 1 : 0); const char *stripped = targetm.strip_name_encoding (skipped); if (*name != '*' && user_label_prefix[0]) - stripped = ACONCAT ((user_label_prefix, stripped, NULL)); + stripped = ACONCAT ((user_label_prefix, stripped, nullptr)); return get_identifier (stripped); } diff --git a/gcc/toplev.c b/gcc/toplev.c index 95eea63380f..a0311d8485b 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -573,7 +573,7 @@ compile_file (void) if (strcmp ("(GCC) ", pkgversion_string)) pkg_version = pkgversion_string; - ident_str = ACONCAT (("GCC: ", pkg_version, version_string, NULL)); + ident_str = ACONCAT (("GCC: ", pkg_version, version_string, nullptr)); targetm.asm_out.output_ident (ident_str); } @@ -1112,7 +1112,7 @@ open_auxiliary_file (const char *ext) char *filename; FILE *file; - filename = concat (aux_base_name, ".", ext, NULL); + filename = concat (aux_base_name, ".", ext, nullptr); file = fopen (filename, "w"); if (!file) fatal_error (input_location, "cannot open %s for writing: %m", filename); diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index b6b9157006b..59619309c22 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -4850,7 +4850,7 @@ tm_mangle (tree old_asm_id) do_unencoded: sprintf (length, "%u", IDENTIFIER_LENGTH (old_asm_id)); - tm_name = concat ("_ZGTt", length, old_asm_name, NULL); + tm_name = concat ("_ZGTt", length, old_asm_name, nullptr); } else { @@ -4875,7 +4875,7 @@ tm_mangle (tree old_asm_id) break; } - tm_name = concat ("_ZGTt", old_asm_name, NULL); + tm_name = concat ("_ZGTt", old_asm_name, nullptr); } free (alloc); diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c index c5febcea3eb..f5f24bbee3b 100644 --- a/gcc/tree-complex.c +++ b/gcc/tree-complex.c @@ -446,7 +446,7 @@ create_one_component_var (tree type, tree orig, const char *prefix, if (DECL_NAME (orig) && !DECL_IGNORED_P (orig)) { const char *name = IDENTIFIER_POINTER (DECL_NAME (orig)); - name = ACONCAT ((name, suffix, NULL)); + name = ACONCAT ((name, suffix, nullptr)); DECL_NAME (r) = get_identifier (name); SET_DECL_DEBUG_EXPR (r, build1 (code, type, orig)); diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index de168df70a1..5f92edb5837 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -226,7 +226,7 @@ get_frame_type (struct nesting_info *info) name = concat ("FRAME.", IDENTIFIER_POINTER (DECL_NAME (info->context)), - NULL); + nullptr); TYPE_NAME (type) = get_identifier (name); free (name); diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index 6c0838261a1..18b954ce278 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -136,7 +136,7 @@ gimple_init_gcov_profiler (void) gcov_type_ptr, gcov_type_node, integer_type_node, unsigned_type_node, NULL_TREE); - fn_name = concat ("__gcov_interval_profiler", fn_suffix, NULL); + fn_name = concat ("__gcov_interval_profiler", fn_suffix, nullptr); tree_interval_profiler_fn = build_fn_decl (fn_name, interval_profiler_fn_type); free (CONST_CAST (char *, fn_name)); @@ -150,7 +150,7 @@ gimple_init_gcov_profiler (void) = build_function_type_list (void_type_node, gcov_type_ptr, gcov_type_node, NULL_TREE); - fn_name = concat ("__gcov_pow2_profiler", fn_suffix, NULL); + fn_name = concat ("__gcov_pow2_profiler", fn_suffix, nullptr); tree_pow2_profiler_fn = build_fn_decl (fn_name, pow2_profiler_fn_type); free (CONST_CAST (char *, fn_name)); TREE_NOTHROW (tree_pow2_profiler_fn) = 1; @@ -163,7 +163,7 @@ gimple_init_gcov_profiler (void) = build_function_type_list (void_type_node, gcov_type_ptr, gcov_type_node, NULL_TREE); - fn_name = concat ("__gcov_topn_values_profiler", fn_suffix, NULL); + fn_name = concat ("__gcov_topn_values_profiler", fn_suffix, nullptr); tree_topn_values_profiler_fn = build_fn_decl (fn_name, topn_values_profiler_fn_type); free (CONST_CAST (char *, fn_name)); @@ -181,7 +181,7 @@ gimple_init_gcov_profiler (void) gcov_type_node, ptr_type_node, NULL_TREE); - fn_name = concat ("__gcov_indirect_call_profiler_v4", fn_suffix, NULL); + fn_name = concat ("__gcov_indirect_call_profiler_v4", fn_suffix, nullptr); tree_indirect_call_profiler_fn = build_fn_decl (fn_name, ic_profiler_fn_type); free (CONST_CAST (char *, fn_name)); @@ -205,7 +205,7 @@ gimple_init_gcov_profiler (void) average_profiler_fn_type = build_function_type_list (void_type_node, gcov_type_ptr, gcov_type_node, NULL_TREE); - fn_name = concat ("__gcov_average_profiler", fn_suffix, NULL); + fn_name = concat ("__gcov_average_profiler", fn_suffix, nullptr); tree_average_profiler_fn = build_fn_decl (fn_name, average_profiler_fn_type); free (CONST_CAST (char *, fn_name)); @@ -213,7 +213,7 @@ gimple_init_gcov_profiler (void) DECL_ATTRIBUTES (tree_average_profiler_fn) = tree_cons (get_identifier ("leaf"), NULL, DECL_ATTRIBUTES (tree_average_profiler_fn)); - fn_name = concat ("__gcov_ior_profiler", fn_suffix, NULL); + fn_name = concat ("__gcov_ior_profiler", fn_suffix, nullptr); tree_ior_profiler_fn = build_fn_decl (fn_name, average_profiler_fn_type); free (CONST_CAST (char *, fn_name)); TREE_NOTHROW (tree_ior_profiler_fn) = 1; diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 2365a3925bb..e5763cc65e3 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -4448,7 +4448,7 @@ vect_get_new_vect_var (tree type, enum vect_var_kind var_kind, const char *name) if (name) { - char* tmp = concat (prefix, "_", name, NULL); + char* tmp = concat (prefix, "_", name, nullptr); new_vect_var = create_tmp_reg (type, tmp); free (tmp); } @@ -4483,7 +4483,7 @@ vect_get_new_ssa_name (tree type, enum vect_var_kind var_kind, const char *name) if (name) { - char* tmp = concat (prefix, "_", name, NULL); + char* tmp = concat (prefix, "_", name, nullptr); new_vect_var = make_temp_ssa_name (type, NULL, tmp); free (tmp); } diff --git a/gcc/tree.c b/gcc/tree.c index 805f669a945..47bd8f13fe7 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -10756,13 +10756,13 @@ build_common_builtin_nodes (void) /* For -ftrapping-math these should throw from a former -fnon-call-exception stmt. */ built_in_names[mcode] = concat (prefix, "mul", mode_name_buf, "3", - NULL); + nullptr); local_define_builtin (built_in_names[mcode], ftype, mcode, built_in_names[mcode], ECF_CONST | ECF_LEAF); built_in_names[dcode] = concat (prefix, "div", mode_name_buf, "3", - NULL); + nullptr); local_define_builtin (built_in_names[dcode], ftype, dcode, built_in_names[dcode], ECF_CONST | ECF_LEAF); diff --git a/gcc/varasm.c b/gcc/varasm.c index 84df52013d7..3f4730d9d52 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -545,7 +545,7 @@ get_named_text_section (tree decl, stripped_name = targetm.strip_name_encoding (name); - buffer = ACONCAT ((stripped_name, named_section_suffix, NULL)); + buffer = ACONCAT ((stripped_name, named_section_suffix, nullptr)); return get_named_section (decl, buffer, 0); } else if (symtab_node::get (decl)->implicit_section) @@ -559,7 +559,7 @@ get_named_text_section (tree decl, name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); name = targetm.strip_name_encoding (name); return get_named_section (decl, ACONCAT ((text_section_name, ".", - name, NULL)), 0); + name, nullptr)), 0); } else return NULL; @@ -6918,7 +6918,7 @@ default_unique_section (tree decl, int reloc) prefix to the section name. */ linkonce = one_only ? ".gnu.linkonce" : ""; - string = ACONCAT ((linkonce, prefix, ".", name, NULL)); + string = ACONCAT ((linkonce, prefix, ".", name, nullptr)); set_decl_section_name (decl, string); } @@ -8113,7 +8113,7 @@ default_asm_output_ident_directive (const char *ident_str) writing to asm_out_file, to handle #ident or Pragma Ident. */ if (symtab->state == PARSING) { - char *buf = ACONCAT ((ident_asm_op, "\"", ident_str, "\"\n", NULL)); + char *buf = ACONCAT ((ident_asm_op, "\"", ident_str, "\"\n", nullptr)); symtab->finalize_toplevel_asm (build_string (strlen (buf), buf)); } else -- 2.25.4