---------- Forwarded message ---------
From: David CARLIER <[email protected]>
Date: Tue, 28 May 2019 at 10:16
Subject: Re: [PATCH] Fix few build warnings with LLVM toolchain
To: Segher Boessenkool <[email protected]>
All right, here an updated version, hope it looks better.
Thanks.
On Tue, 28 May 2019 at 10:09, Segher Boessenkool
<[email protected]> wrote:
>
> On Tue, May 28, 2019 at 09:31:18AM +0000, David CARLIER wrote:
> > Here a tiny patch to fix few build warnings.
>
> Please mention what the warning _is_, and why it is correct / why it is
> a good idea to make these changes.
>
>
> Segher
Fixing few build warnings with clang/clang++ of this type:
../.././gcc/coretypes.h:76:1: warning: class 'rtx_def' was previously declared as a struct; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
or
../.././gcc/machmode.h:320:1: warning: 'pod_mode' defined as a struct template here but previously declared as a class template; this is valid, but may result in linker errors under the
Microsoft C++ ABI [-Wmismatched-tags]
The struct/class mismatch is mostly harmless, might be for Microsoft toolchain as mentioned above, but in general for correctness.
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog (revision 271684)
+++ gcc/ChangeLog (working copy)
@@ -1,3 +1,7 @@
+2019-05-28 David Carlier <[email protected]>
+
+ * coretypes.h: Fix build warning, chaing few classes to struct.
+
2019-05-27 Jakub Jelinek <[email protected]>
* gimplify.c (gimplify_scan_omp_clauses): Allow lastprivate conditional
Index: gcc/coretypes.h
===================================================================
--- gcc/coretypes.h (revision 271684)
+++ gcc/coretypes.h (working copy)
@@ -65,7 +65,7 @@ template<typename> class opt_mode;
typedef opt_mode<scalar_mode> opt_scalar_mode;
typedef opt_mode<scalar_int_mode> opt_scalar_int_mode;
typedef opt_mode<scalar_float_mode> opt_scalar_float_mode;
-template<typename> class pod_mode;
+template<typename> struct pod_mode;
typedef pod_mode<scalar_mode> scalar_mode_pod;
typedef pod_mode<scalar_int_mode> scalar_int_mode_pod;
typedef pod_mode<fixed_size_mode> fixed_size_mode_pod;
@@ -73,7 +73,7 @@ typedef pod_mode<fixed_size_mode> fixed_
/* Subclasses of rtx_def, using indentation to show the class
hierarchy, along with the relevant invariant.
Where possible, keep this list in the same order as in rtl.def. */
-class rtx_def;
+struct rtx_def;
class rtx_expr_list; /* GET_CODE (X) == EXPR_LIST */
class rtx_insn_list; /* GET_CODE (X) == INSN_LIST */
class rtx_sequence; /* GET_CODE (X) == SEQUENCE */
@@ -138,7 +138,7 @@ struct gomp_teams;
/* Subclasses of symtab_node, using indentation to show the class
hierarchy. */
-class symtab_node;
+struct symtab_node;
struct cgraph_node;
class varpool_node;
Index: gcc/hash-table.h
===================================================================
--- gcc/hash-table.h (revision 271684)
+++ gcc/hash-table.h (working copy)
@@ -347,7 +347,7 @@ hash_table_mod2 (hashval_t hash, unsigne
return 1 + mul_mod (hash, p->prime - 2, p->inv_m2, p->shift);
}
-class mem_usage;
+struct mem_usage;
/* User-facing hash table type.