Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-07 Thread Jason Merrill
On 2/7/19 6:27 PM, Martin Sebor wrote: On 2/7/19 4:00 PM, Jason Merrill wrote: On 2/7/19 1:57 PM, Martin Sebor wrote: +  /* The original numeric size as seen in the source code after + any substitution and before conversion to size_t.  */ I don't think this should mention substitution.  W

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-07 Thread Martin Sebor
On 2/7/19 4:00 PM, Jason Merrill wrote: On 2/7/19 1:57 PM, Martin Sebor wrote: +  /* The original numeric size as seen in the source code after + any substitution and before conversion to size_t.  */ I don't think this should mention substitution.  With that tweak the C++ changes are OK.

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-07 Thread Jason Merrill
On 2/7/19 1:57 PM, Martin Sebor wrote: + /* The original numeric size as seen in the source code after + any substitution and before conversion to size_t. */ I don't think this should mention substitution. With that tweak the C++ changes are OK. Jason

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-07 Thread Martin Sebor
On 2/7/19 9:10 AM, Jason Merrill wrote: On 2/5/19 4:55 PM, Martin Sebor wrote: On 2/5/19 12:14 PM, Jason Merrill wrote: On 2/5/19 1:46 PM, Martin Sebor wrote: On 2/1/19 7:41 AM, Jason Merrill wrote: On 1/31/19 5:49 PM, Martin Sebor wrote: On 1/30/19 3:15 PM, Jason Merrill wrote: On 1/29/19

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-07 Thread Jason Merrill
On 2/5/19 4:55 PM, Martin Sebor wrote: On 2/5/19 12:14 PM, Jason Merrill wrote: On 2/5/19 1:46 PM, Martin Sebor wrote: On 2/1/19 7:41 AM, Jason Merrill wrote: On 1/31/19 5:49 PM, Martin Sebor wrote: On 1/30/19 3:15 PM, Jason Merrill wrote: On 1/29/19 7:15 PM, Martin Sebor wrote: +  /* T

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-05 Thread Martin Sebor
On 2/5/19 12:14 PM, Jason Merrill wrote: On 2/5/19 1:46 PM, Martin Sebor wrote: On 2/1/19 7:41 AM, Jason Merrill wrote: On 1/31/19 5:49 PM, Martin Sebor wrote: On 1/30/19 3:15 PM, Jason Merrill wrote: On 1/29/19 7:15 PM, Martin Sebor wrote: +  /* Try to convert the original SIZE to a ssi

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-05 Thread Jason Merrill
On 2/5/19 1:46 PM, Martin Sebor wrote: On 2/1/19 7:41 AM, Jason Merrill wrote: On 1/31/19 5:49 PM, Martin Sebor wrote: On 1/30/19 3:15 PM, Jason Merrill wrote: On 1/29/19 7:15 PM, Martin Sebor wrote: +  /* Try to convert the original SIZE to a ssizetype.  */ +  if (orig_size != error_

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-05 Thread Martin Sebor
On 2/1/19 7:41 AM, Jason Merrill wrote: On 1/31/19 5:49 PM, Martin Sebor wrote: On 1/30/19 3:15 PM, Jason Merrill wrote: On 1/29/19 7:15 PM, Martin Sebor wrote: +  /* Try to convert the original SIZE to a ssizetype.  */ +  if (orig_size != error_mark_node +  && !TYPE_UNSIGNED (

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-02-01 Thread Jason Merrill
On 1/31/19 5:49 PM, Martin Sebor wrote: On 1/30/19 3:15 PM, Jason Merrill wrote: On 1/29/19 7:15 PM, Martin Sebor wrote: +  /* Try to convert the original SIZE to a ssizetype.  */ +  if (orig_size != error_mark_node +  && !TYPE_UNSIGNED (TREE_TYPE (orig_size))) +    { + 

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-01-31 Thread Martin Sebor
On 1/30/19 3:15 PM, Jason Merrill wrote: On 1/29/19 7:15 PM, Martin Sebor wrote: +  /* Try to convert the original SIZE to a ssizetype.  */ +  if (orig_size != error_mark_node +  && !TYPE_UNSIGNED (TREE_TYPE (orig_size))) +    { +  if (TREE_CODE (size) == INTEGER_CST

Re: [PATCH] print correct array sizes in errors (PR 87996)

2019-01-30 Thread Jason Merrill
On 1/29/19 7:15 PM, Martin Sebor wrote: + /* Try to convert the original SIZE to a ssizetype. */ + if (orig_size != error_mark_node + && !TYPE_UNSIGNED (TREE_TYPE (orig_size))) + { + if (TREE_CODE (size) == INTEGER_CST + && tree_i

[PATCH] print correct array sizes in errors (PR 87996)

2019-01-29 Thread Martin Sebor
PR c++/87996 is a P2 regression reported in December about C++ error messages for declarations of arrays larger than PTRDIFF_MAX saying the sizes of the arrays are negative. GCC 7 says they're negative. The attached patch corrects that by issuing messages that, besides reflecting the correct sig