public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, wide-int] change fixed_wide_int_storage from class to struct
@ 2016-05-15 19:03 Gerald Pfeifer
  2016-05-15 20:30 ` Andrew Pinski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gerald Pfeifer @ 2016-05-15 19:03 UTC (permalink / raw)
  To: gcc-patches, Mike Stump; +Cc: Richard Sandiford, Kenneth Zadeck

While not a bug according to the language of the C++ standard, this
causes dozens of warnings when building GCC with clang, and there is
not benefit of mixing struct and class like this.

Mike, when I had a similar case a while ago you sounded pretty 
supportive of this kind of change.  Would you be fine to pre-approve
such changes?

Gerald

2016-05-15  Gerald Pfeifer  <gerald@pfeifer.com>

	* wide-int.h: Change fixed_wide_int_storage from class to struct.

Index: wide-int.h
===================================================================
--- wide-int.h	(revision 236255)
+++ wide-int.h	(working copy)
@@ -294,7 +294,7 @@
   HOST_WIDE_INT *VAL = RESULT.write_val ()
 
 template <typename T> class generic_wide_int;
-template <int N> struct fixed_wide_int_storage;
+template <int N> class fixed_wide_int_storage;
 class wide_int_storage;
 
 /* An N-bit integer.  Until we can use typedef templates, use this instead.  */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, wide-int] change fixed_wide_int_storage from class to struct
  2016-05-15 19:03 [PATCH, wide-int] change fixed_wide_int_storage from class to struct Gerald Pfeifer
@ 2016-05-15 20:30 ` Andrew Pinski
  2016-05-17 15:38   ` Mike Stump
  2016-05-16  5:37 ` Richard Biener
  2016-05-17  7:16 ` Mike Stump
  2 siblings, 1 reply; 5+ messages in thread
From: Andrew Pinski @ 2016-05-15 20:30 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: GCC Patches, Mike Stump, Richard Sandiford, Kenneth Zadeck

On Sun, May 15, 2016 at 12:03 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> While not a bug according to the language of the C++ standard, this
> causes dozens of warnings when building GCC with clang, and there is
> not benefit of mixing struct and class like this.
>
> Mike, when I had a similar case a while ago you sounded pretty
> supportive of this kind of change.  Would you be fine to pre-approve
> such changes?

Can we recommend that clang disable this warning by default instead?
Or use an option flag to disable the warning while compiling gcc?

Thanks,
Andrew

>
> Gerald
>
> 2016-05-15  Gerald Pfeifer  <gerald@pfeifer.com>
>
>         * wide-int.h: Change fixed_wide_int_storage from class to struct.
>
> Index: wide-int.h
> ===================================================================
> --- wide-int.h  (revision 236255)
> +++ wide-int.h  (working copy)
> @@ -294,7 +294,7 @@
>    HOST_WIDE_INT *VAL = RESULT.write_val ()
>
>  template <typename T> class generic_wide_int;
> -template <int N> struct fixed_wide_int_storage;
> +template <int N> class fixed_wide_int_storage;
>  class wide_int_storage;
>
>  /* An N-bit integer.  Until we can use typedef templates, use this instead.  */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, wide-int] change fixed_wide_int_storage from class to struct
  2016-05-15 19:03 [PATCH, wide-int] change fixed_wide_int_storage from class to struct Gerald Pfeifer
  2016-05-15 20:30 ` Andrew Pinski
@ 2016-05-16  5:37 ` Richard Biener
  2016-05-17  7:16 ` Mike Stump
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Biener @ 2016-05-16  5:37 UTC (permalink / raw)
  To: Gerald Pfeifer, gcc-patches, Mike Stump; +Cc: Richard Sandiford, Kenneth Zadeck

On May 15, 2016 9:03:22 PM GMT+02:00, Gerald Pfeifer <gerald@pfeifer.com> wrote:
>While not a bug according to the language of the C++ standard, this
>causes dozens of warnings when building GCC with clang, and there is
>not benefit of mixing struct and class like this.
>
>Mike, when I had a similar case a while ago you sounded pretty 
>supportive of this kind of change.  Would you be fine to pre-approve
>such changes?

Yes, they are OK.

Thanks,
Richard.

>Gerald
>
>2016-05-15  Gerald Pfeifer  <gerald@pfeifer.com>
>
>	* wide-int.h: Change fixed_wide_int_storage from class to struct.
>
>Index: wide-int.h
>===================================================================
>--- wide-int.h	(revision 236255)
>+++ wide-int.h	(working copy)
>@@ -294,7 +294,7 @@
>   HOST_WIDE_INT *VAL = RESULT.write_val ()
> 
> template <typename T> class generic_wide_int;
>-template <int N> struct fixed_wide_int_storage;
>+template <int N> class fixed_wide_int_storage;
> class wide_int_storage;
> 
>/* An N-bit integer.  Until we can use typedef templates, use this
>instead.  */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, wide-int] change fixed_wide_int_storage from class to struct
  2016-05-15 19:03 [PATCH, wide-int] change fixed_wide_int_storage from class to struct Gerald Pfeifer
  2016-05-15 20:30 ` Andrew Pinski
  2016-05-16  5:37 ` Richard Biener
@ 2016-05-17  7:16 ` Mike Stump
  2 siblings, 0 replies; 5+ messages in thread
From: Mike Stump @ 2016-05-17  7:16 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches, Mike Stump, Richard Sandiford, Kenneth Zadeck

On May 15, 2016, at 12:03 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> While not a bug according to the language of the C++ standard, this
> causes dozens of warnings when building GCC with clang, and there is
> not benefit of mixing struct and class like this.
> 
> Mike, when I had a similar case a while ago you sounded pretty 
> supportive of this kind of change.  Would you be fine to pre-approve
> such change?

There was no intention to have this struct/class mismatch.  As Richard already said, Ok.  Ok for back porting as well.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, wide-int] change fixed_wide_int_storage from class to struct
  2016-05-15 20:30 ` Andrew Pinski
@ 2016-05-17 15:38   ` Mike Stump
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Stump @ 2016-05-17 15:38 UTC (permalink / raw)
  To: Andrew Pinski
  Cc: Gerald Pfeifer, GCC Patches, Richard Sandiford, Kenneth Zadeck

On May 15, 2016, at 1:30 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> 
> Can we recommend that clang disable this warning by default instead?

No.  We want to ensure the class/struct tags match as there is no good reason to have them differ.

> Or use an option flag to disable the warning while compiling gcc?

Don't need the option to disable it, as once we fix gcc, it won't produce these warnings.  If clang produces warnings for constructs we do want to use, then we disable those warnings as uninteresting.  For example, if they warned for line widths more than 80, and we don't have a hard rule about 80, then we'd turn it off as overly pedantic for our source base, even though in most files, most of the time we were 80 or under.  If we had a hard and fast rule, no lines over 80, ever, then we'd not turn that warning off, rather, we would fixed the software to conform to that.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-17 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-15 19:03 [PATCH, wide-int] change fixed_wide_int_storage from class to struct Gerald Pfeifer
2016-05-15 20:30 ` Andrew Pinski
2016-05-17 15:38   ` Mike Stump
2016-05-16  5:37 ` Richard Biener
2016-05-17  7:16 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).