On 09/13/18 20:44, Jeff Law wrote:
> On 8/24/18 2:18 PM, Bernd Edlinger wrote:
>> Hi!
>>
>>
>> This is an alternative approach in making STRING_CST semantics
>> consistent.
>>
>> This means it makes STRING_CST used for literals and for initializers
>> use exactly the same semantics.
>>
>> It makes sure that all STRING_CST have a TYPE_SIZE_UNIT, and that it is
>> always larger than TREE_STRING_LENGTH, these and certain other properties
>> are checked in varasm.c, so the currently observed consistency issues
>> in the middle-end can be resolved.
>>
>>
>> It depends on the following pre-condition patches:
> [ ... ]
> 
>>
>> [PATCHv2] Handle overlength strings in C++ FE
>> https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01567.html
> I've committed this patch to the trunk.
> 

Note, however this leaves pr87503.c semi-broken:

gcc -fpermissive -x c++ -O2 pr87053.c
pr87053.c:11:23: warning: initializer-string for array of chars is too long 
[-fpermissive]
11 | } u = {{"1234", "567"}};
    |                       ^
$ ./a.out
Aborted (core dumped)


This would be fixed by the patch I posted earlier today:

https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00690.html



Thanks
Bernd.

Reply via email to