On 07/05/2017 02:58 PM, Andrew Pinski wrote:
On Sun, Apr 30, 2017 at 1:02 PM, Pedro Alves wrote:
Hi Martin,
Thanks much for doing this. A few comments below, in light of my
experience doing the equivalent checks in the gdb patch linked below,
using standard C++11.
On
On Sun, Apr 30, 2017 at 1:02 PM, Pedro Alves wrote:
> Hi Martin,
>
> Thanks much for doing this. A few comments below, in light of my
> experience doing the equivalent checks in the gdb patch linked below,
> using standard C++11.
>
> On 04/29/2017 09:09 PM, Martin Sebor wrote:
On 29/06/17 17:15, Jan Hubicka wrote:
> Hello,
>> diff --git a/gcc/hash-table.h b/gcc/hash-table.h
>> index 0f7e21a..443d16c 100644
>> --- a/gcc/hash-table.h
>> +++ b/gcc/hash-table.h
>> @@ -803,7 +803,10 @@ hash_table::empty_slow ()
>>m_size_prime_index = nindex;
>>
On 06/30/2017 02:34 AM, Richard Biener wrote:
On Thu, Jun 29, 2017 at 10:23 PM, Martin Sebor wrote:
On 06/29/2017 10:15 AM, Jan Hubicka wrote:
Hello,
diff --git a/gcc/hash-table.h b/gcc/hash-table.h
index 0f7e21a..443d16c 100644
--- a/gcc/hash-table.h
+++
On Thu, Jun 29, 2017 at 10:23 PM, Martin Sebor wrote:
> On 06/29/2017 10:15 AM, Jan Hubicka wrote:
>>
>> Hello,
>>>
>>> diff --git a/gcc/hash-table.h b/gcc/hash-table.h
>>> index 0f7e21a..443d16c 100644
>>> --- a/gcc/hash-table.h
>>> +++ b/gcc/hash-table.h
>>> @@ -803,7 +803,10
On 06/29/2017 04:34 PM, Jan Hubicka wrote:
The warning in the original code could have been suppressed (by
casting the pointer to char*), but it was valid so I opted not
to. I'd expect it to be possible to work around the bug but
I don't have easy access to GCC 4.2 to reproduce it or verify
>
> The warning in the original code could have been suppressed (by
> casting the pointer to char*), but it was valid so I opted not
> to. I'd expect it to be possible to work around the bug but
> I don't have easy access to GCC 4.2 to reproduce it or verify
> the fix.
>
> FWIW, after looking
On 06/29/2017 10:15 AM, Jan Hubicka wrote:
Hello,
diff --git a/gcc/hash-table.h b/gcc/hash-table.h
index 0f7e21a..443d16c 100644
--- a/gcc/hash-table.h
+++ b/gcc/hash-table.h
@@ -803,7 +803,10 @@ hash_table::empty_slow ()
m_size_prime_index = nindex;
}
else
Hello,
> diff --git a/gcc/hash-table.h b/gcc/hash-table.h
> index 0f7e21a..443d16c 100644
> --- a/gcc/hash-table.h
> +++ b/gcc/hash-table.h
> @@ -803,7 +803,10 @@ hash_table::empty_slow ()
>m_size_prime_index = nindex;
> }
>else
> -memset (entries, 0,
On Fri, Jun 16, 2017 at 9:38 AM, Richard Biener
wrote:
> On Thu, Jun 15, 2017 at 11:31 PM, Jason Merrill wrote:
>> On Thu, Jun 15, 2017 at 12:26 PM, Martin Sebor wrote:
>>> On 06/12/2017 03:36 PM, Jason Merrill wrote:
On
On Thu, Jun 15, 2017 at 11:31 PM, Jason Merrill wrote:
> On Thu, Jun 15, 2017 at 12:26 PM, Martin Sebor wrote:
>> On 06/12/2017 03:36 PM, Jason Merrill wrote:
>>>
>>> On 06/08/2017 01:25 PM, Martin Sebor wrote:
+ if (TREE_CHAIN (DECL_ARGUMENTS
On Thu, Jun 15, 2017 at 12:26 PM, Martin Sebor wrote:
> On 06/12/2017 03:36 PM, Jason Merrill wrote:
>>
>> On 06/08/2017 01:25 PM, Martin Sebor wrote:
>>>
>>> + if (TREE_CHAIN (DECL_ARGUMENTS (f)))
>>> +{
>>> + /* Skip constructors that aren't copy or move ctors.
On 06/12/2017 03:36 PM, Jason Merrill wrote:
On 06/08/2017 01:25 PM, Martin Sebor wrote:
+ if (TREE_CHAIN (DECL_ARGUMENTS (f)))
+{
+ /* Skip constructors that aren't copy or move ctors. */
+ if (!copy_fn_p (f))
+continue;
+
+ cpy_or_move_ctor_p = true;
+}
+
On 06/08/2017 01:25 PM, Martin Sebor wrote:
+ if (TREE_CHAIN (DECL_ARGUMENTS (f)))
+ {
+ /* Skip constructors that aren't copy or move ctors. */
+ if (!copy_fn_p (f))
+ continue;
+
+ cpy_or_move_ctor_p = true;
+ }
+ else
+ {
+
On 06/07/2017 07:09 PM, Jason Merrill wrote:
On 06/06/2017 03:24 PM, Martin Sebor wrote:
+ /* Iterate over copy and move assignment overloads. */
+
+ for (ovl_iterator oi (fns); oi; ++oi)
+{
+ tree f = *oi;
+
+ bool accessible = !access || !(TREE_PRIVATE (f) ||
TREE_PROTECTED
On 06/06/2017 03:24 PM, Martin Sebor wrote:
+ /* Iterate over copy and move assignment overloads. */
+
+ for (ovl_iterator oi (fns); oi; ++oi)
+{
+ tree f = *oi;
+
+ bool accessible = !access || !(TREE_PRIVATE (f) || TREE_PROTECTED (f));
+
+ /* Skip template assignment
On 06/05/2017 07:53 PM, Martin Sebor wrote:
On 06/05/2017 01:13 PM, Martin Sebor wrote:
On 06/05/2017 10:07 AM, Martin Sebor wrote:
Maybe I should use a different approach and instead of trying
to see if a function is deleted use trivially_xible to see if
it's usable. That will mean changing
On 06/05/2017 01:13 PM, Martin Sebor wrote:
On 06/05/2017 10:07 AM, Martin Sebor wrote:
Maybe I should use a different approach and instead of trying
to see if a function is deleted use trivially_xible to see if
it's usable. That will mean changing the diagnostics from
"with a deleted special
On 06/05/2017 10:07 AM, Martin Sebor wrote:
Maybe I should use a different approach and instead of trying
to see if a function is deleted use trivially_xible to see if
it's usable. That will mean changing the diagnostics from
"with a deleted special function" to "without trivial special
Maybe I should use a different approach and instead of trying
to see if a function is deleted use trivially_xible to see if
it's usable. That will mean changing the diagnostics from
"with a deleted special function" to "without trivial special
function" but it will avoid calling
On 06/04/2017 10:01 PM, Jason Merrill wrote:
On 06/02/2017 05:28 PM, Martin Sebor wrote:
On 05/31/2017 05:34 PM, Jason Merrill wrote:
On 05/27/2017 06:44 PM, Martin Sebor wrote:
+ /* True if the class is trivial and has a trivial non-deleted copy
+ assignment, copy ctor, and default
On 06/02/2017 05:28 PM, Martin Sebor wrote:
On 05/31/2017 05:34 PM, Jason Merrill wrote:
On 05/27/2017 06:44 PM, Martin Sebor wrote:
+ /* True if the class is trivial and has a trivial non-deleted copy
+ assignment, copy ctor, and default ctor, respectively. The last
+ one isn't used
On 05/31/2017 05:34 PM, Jason Merrill wrote:
On 05/27/2017 06:44 PM, Martin Sebor wrote:
+ /* True if the class is trivial and has a trivial non-deleted copy
+ assignment, copy ctor, and default ctor, respectively. The last
+ one isn't used to issue warnings but only to decide what
On 05/27/2017 06:44 PM, Martin Sebor wrote:
+ /* True if the class is trivial and has a trivial non-deleted copy
+ assignment, copy ctor, and default ctor, respectively. The last
+ one isn't used to issue warnings but only to decide what suitable
+ alternatives to offer as
+/* Return true if class TYPE meets a relaxed definition of
standard-layout.
+ In particular, the requirement that it "has all non-static data
members
+ nd bit-fields in the class and its base classes first declared in the
+ same class" is not considered. */
+
+static bool
On 05/24/2017 04:28 PM, Martin Sebor wrote:
Attached is an updated patch with the requested changes. I've
also renamed the option -Wclass-memaccess to avoid suggesting
that the warning focuses solely on non-trivial types, and
updated its wording and comments throughout to refer to value
Attached is an updated patch with the requested changes. I've
also renamed the option -Wclass-memaccess to avoid suggesting
that the warning focuses solely on non-trivial types, and
updated its wording and comments throughout to refer to value
initialization rather than default initialization.
On 05/21/2017 10:50 PM, Jason Merrill wrote:
On Sun, May 21, 2017 at 7:59 PM, Martin Sebor wrote:
On 05/19/2017 03:42 PM, Jason Merrill wrote:
On Fri, May 19, 2017 at 4:07 PM, Martin Sebor wrote:
On 05/19/2017 01:07 PM, Jason Merrill wrote:
On Tue, May
On Sun, May 21, 2017 at 7:59 PM, Martin Sebor wrote:
> On 05/19/2017 03:42 PM, Jason Merrill wrote:
>> On Fri, May 19, 2017 at 4:07 PM, Martin Sebor wrote:
>>> On 05/19/2017 01:07 PM, Jason Merrill wrote:
On Tue, May 16, 2017 at 5:39 PM, Martin Sebor
On 05/19/2017 03:42 PM, Jason Merrill wrote:
On Fri, May 19, 2017 at 4:07 PM, Martin Sebor wrote:
On 05/19/2017 01:07 PM, Jason Merrill wrote:
On Tue, May 16, 2017 at 5:39 PM, Martin Sebor wrote:
On 05/16/2017 01:41 PM, Jason Merrill wrote:
I'm still
On Fri, May 19, 2017 at 4:07 PM, Martin Sebor wrote:
> On 05/19/2017 01:07 PM, Jason Merrill wrote:
>>
>> On Tue, May 16, 2017 at 5:39 PM, Martin Sebor wrote:
>>>
>>> On 05/16/2017 01:41 PM, Jason Merrill wrote:
>>>
I'm still not convinced we need to
On 05/19/2017 01:07 PM, Jason Merrill wrote:
On Tue, May 16, 2017 at 5:39 PM, Martin Sebor wrote:
On 05/16/2017 01:41 PM, Jason Merrill wrote:
I'm still not convinced we need to consider standard-layout at all.
I agree. The patch doesn't make use of
On Tue, May 16, 2017 at 5:39 PM, Martin Sebor wrote:
> On 05/16/2017 01:41 PM, Jason Merrill wrote:
>
>> I'm still not convinced we need to consider standard-layout at all.
>
> I agree. The patch doesn't make use of is_standard_layout_p().
> It defines its own helper called
[Meant to add this to the other email, but forgot to copy it back.]
On 05/12/2017 03:31 AM, Martin Sebor wrote:
> + // Zeroing out is diagnosed only because it's difficult not to.
> + // Otherwise, a class that's non-trivial only because it has
> + // a non-trivial dtor can be safely zeroed
On 05/17/2017 02:55 AM, Martin Sebor wrote:
> On 05/16/2017 04:48 PM, Pedro Alves wrote:
>> On 05/16/2017 08:41 PM, Jason Merrill wrote:
>>
>>> I agree that it makes sense to
>>> check for a trivial assignment operator specifically. I guess we want
>>> a slightly stronger "trivially copyable"
On 05/16/2017 04:48 PM, Pedro Alves wrote:
On 05/16/2017 08:41 PM, Jason Merrill wrote:
I agree that it makes sense to
check for a trivial assignment operator specifically. I guess we want
a slightly stronger "trivially copyable" that also requires a
non-deleted assignment operator.
It seems
On 05/16/2017 08:41 PM, Jason Merrill wrote:
> I agree that it makes sense to
> check for a trivial assignment operator specifically. I guess we want
> a slightly stronger "trivially copyable" that also requires a
> non-deleted assignment operator.
>
> It seems to me that the relevant tests
On 05/16/2017 01:41 PM, Jason Merrill wrote:
On Thu, May 11, 2017 at 12:23 PM, Martin Sebor wrote:
The challenge with using memcpy or memset with class types is
figuring out if it's being called to copy-construct a new object
or assign a new value to an existing one. In
On Thu, May 11, 2017 at 12:23 PM, Martin Sebor wrote:
> The challenge with using memcpy or memset with class types is
> figuring out if it's being called to copy-construct a new object
> or assign a new value to an existing one. In general it's not
> possible to tell so the
I found a few more instances of the warning and a couple of bugs
in the fixes for it. The attached update corrects those as well.
On 05/11/2017 02:01 PM, Martin Sebor wrote:
Attached is revision 2 of the patch that addresses of the feedback
I got from Pedro (thanks again). As I explained in
Attached is revision 2 of the patch that addresses of the feedback
I got from Pedro (thanks again). As I explained in my response
(https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00925.html) it's not
entirely practical to rely on the strict interpretation of the C++
definition of type triviality
On 05/11/2017 10:34 AM, Jakub Jelinek wrote:
On Thu, May 11, 2017 at 10:23:48AM -0600, Martin Sebor wrote:
Unlike in C, the preferred way to initialize objects in C++
is to use some form of initialization (as opposed to memset).
The preferred way to copy objects is using the copy ctor or
On Thu, May 11, 2017 at 10:23:48AM -0600, Martin Sebor wrote:
> Unlike in C, the preferred way to initialize objects in C++
> is to use some form of initialization (as opposed to memset).
> The preferred way to copy objects is using the copy ctor or
> assignment operator (as opposed to memcpy).
On 04/30/2017 02:02 PM, Pedro Alves wrote:
Hi Martin,
Thanks much for doing this. A few comments below, in light of my
experience doing the equivalent checks in the gdb patch linked below,
using standard C++11.
Thanks for the feedback! It gave me quite a bit to think about.
The challenge
On 04/30/2017 05:39 PM, Joseph Myers wrote:
On Sat, 29 Apr 2017, Martin Sebor wrote:
+The safe way to either initialize or "reset" objects of non-trivial
Should use TeX quotes in Texinfo files, ``reset''.
Heh :) I wrestled with Emacs to get rid of those, It kept replacing
my plain quotes
Pedro's suggestions all sound good to me.
Jason
On Sat, 29 Apr 2017, Martin Sebor wrote:
> +The safe way to either initialize or "reset" objects of non-trivial
Should use TeX quotes in Texinfo files, ``reset''.
--
Joseph S. Myers
jos...@codesourcery.com
Hi Martin,
Thanks much for doing this. A few comments below, in light of my
experience doing the equivalent checks in the gdb patch linked below,
using standard C++11.
On 04/29/2017 09:09 PM, Martin Sebor wrote:
> Calling memset, memcpy, or similar to write to an object of
> a non-trivial type
48 matches
Mail list logo