aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-03-11 22:51:28 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-03-11 22:51:28 +0100
commita95e21151a6366e7344d0f1983f99e318c5a7097 (patch)
tree11d987406d9ce8399ec1736477d971ef09344df2 /gcc/c
parent02d394b2736afa9a24ab3e1b8ad56fd6ac37e0f4 (diff)
parentaf4bb221153359f5948da917d5ef2df738bb1e61 (diff)
downloadgcc-a95e21151a6366e7344d0f1983f99e318c5a7097.zip
gcc-a95e21151a6366e7344d0f1983f99e318c5a7097.tar.gz
gcc-a95e21151a6366e7344d0f1983f99e318c5a7097.tar.bz2
Merge commit 'af4bb221153359f5948da917d5ef2df738bb1e61' into HEAD
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog14
-rw-r--r--gcc/c/Make-lang.in4
-rw-r--r--gcc/c/c-decl.cc21
-rw-r--r--gcc/c/c-objc-common.cc4
4 files changed, 39 insertions, 4 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index c23f756..92e90e7 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,17 @@
+2023-10-17 Martin Uecker <uecker@tugraz.at>
+
+ PR c/111708
+ * c-decl.cc (grokdeclarator): Add error.
+
+2023-10-03 David Malcolm <dmalcolm@redhat.com>
+
+ * c-objc-common.cc (c_tree_printer): Update for "m_" prefixes to
+ text_info fields.
+
+2023-09-30 Eugene Rozenfeld <erozen@microsoft.com>
+
+ * Make-lang.in: Make create_fdas_for_cc1 target not .PHONY
+
2023-09-20 Jakub Jelinek <jakub@redhat.com>
* c-parser.cc (c_parser_postfix_expression_after_primary): Parse
diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in
index 79bc0df..3ef8a67 100644
--- a/gcc/c/Make-lang.in
+++ b/gcc/c/Make-lang.in
@@ -91,8 +91,6 @@ cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS)
components_in_prev = "bfd opcodes binutils fixincludes gas gcc gmp mpfr mpc isl gold intl ld libbacktrace libcpp libcody libdecnumber libiberty libiberty-linker-plugin libiconv zlib lto-plugin libctf libsframe"
components_in_prev_target = "libstdc++-v3 libsanitizer libvtv libgcc libbacktrace libphobos zlib libgomp libatomic"
-.PHONY: create_fdas_for_cc1
-
cc1.fda: create_fdas_for_cc1
$(PROFILE_MERGER) $(shell ls -ha cc1_*.fda) --output_file cc1.fda -gcov_version 2
@@ -116,6 +114,8 @@ create_fdas_for_cc1: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA)
$(CREATE_GCOV) -binary ../prev-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
fi; \
done;
+
+ $(STAMP) $@
#
# Build hooks:
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index 5822faf..0de3847 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -8032,6 +8032,27 @@ grokdeclarator (const struct c_declarator *declarator,
TREE_THIS_VOLATILE (decl) = 1;
}
}
+
+ /* C99 6.2.2p7: It is invalid (compile-time undefined
+ behavior) to create an 'extern' declaration for a
+ function if there is a global declaration that is
+ 'static' and the global declaration is not visible.
+ (If the static declaration _is_ currently visible,
+ the 'extern' declaration is taken to refer to that decl.) */
+ if (!initialized
+ && TREE_PUBLIC (decl)
+ && current_scope != file_scope)
+ {
+ tree global_decl = identifier_global_value (declarator->u.id.id);
+ tree visible_decl = lookup_name (declarator->u.id.id);
+
+ if (global_decl
+ && global_decl != visible_decl
+ && VAR_OR_FUNCTION_DECL_P (global_decl)
+ && !TREE_PUBLIC (global_decl))
+ error_at (loc, "function previously declared %<static%> "
+ "redeclared %<extern%>");
+ }
}
else
{
diff --git a/gcc/c/c-objc-common.cc b/gcc/c/c-objc-common.cc
index e4aed61..c8f49aa 100644
--- a/gcc/c/c-objc-common.cc
+++ b/gcc/c/c-objc-common.cc
@@ -272,7 +272,7 @@ c_tree_printer (pretty_printer *pp, text_info *text, const char *spec,
if (*spec != 'v')
{
- t = va_arg (*text->args_ptr, tree);
+ t = va_arg (*text->m_args_ptr, tree);
if (set_locus)
text->set_location (0, DECL_SOURCE_LOCATION (t),
SHOW_RANGE_WITH_CARET);
@@ -316,7 +316,7 @@ c_tree_printer (pretty_printer *pp, text_info *text, const char *spec,
return true;
case 'v':
- pp_c_cv_qualifiers (cpp, va_arg (*text->args_ptr, int), hash);
+ pp_c_cv_qualifiers (cpp, va_arg (*text->m_args_ptr, int), hash);
return true;
default: