]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx: Resolve 'flexible_array_member_type_p' conflict
authorThomas Schwinge <tschwinge@baylibre.com>
Thu, 9 Jul 2026 22:52:46 +0000 (00:52 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Fri, 10 Jul 2026 06:46:40 +0000 (08:46 +0200)
    [...]/source-gcc/gcc/config/nvptx/nvptx.cc:2485:1: error: ‘bool flexible_array_member_type_p(const_tree)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
     2485 | flexible_array_member_type_p (const_tree type)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from [...]/source-gcc/gcc/config/nvptx/nvptx.cc:30:
    [...]/source-gcc/gcc/tree.h:7022:13: note: previous declaration of ‘bool flexible_array_member_type_p(const_tree)’
     7022 | extern bool flexible_array_member_type_p (const_tree);
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

That's due to recent commit ed1d15e94f5ce28a9fdba6e3b255efef420c93f0
"c: harmonize checking for flex array member type".

gcc/
* config/nvptx/nvptx.cc (flexible_array_member_type_p): Rename to
'nvptx_flexible_array_member_type_p'.

gcc/config/nvptx/nvptx.cc

index a23206910dc46a16ffbf005af38e375c2492cbda..fb76e781350727f87486769045447f405b8abab0 100644 (file)
@@ -2482,7 +2482,7 @@ nvptx_output_ascii (FILE *, const char *str, unsigned HOST_WIDE_INT size)
    given dimension.  */
 
 static bool
-flexible_array_member_type_p (const_tree type)
+nvptx_flexible_array_member_type_p (const_tree type)
 {
   if (TREE_CODE (type) != RECORD_TYPE)
     return false;
@@ -2520,7 +2520,7 @@ nvptx_assemble_decl_begin (FILE *file, const char *name, const char *section,
   bool atype = (TREE_CODE (type) == ARRAY_TYPE)
     && (TYPE_DOMAIN (type) == NULL_TREE);
 
-  if (undefined && flexible_array_member_type_p (type))
+  if (undefined && nvptx_flexible_array_member_type_p (type))
     {
       size = 0;
       atype = true;