[PATCH,FORTRAN 28/29] Free type-bound procedure structs

Harald Anlauf anlauf@gmx.de
Fri Oct 29 19:36:26 GMT 2021


Dear Bernhard, all,

Am 29.10.21 um 02:05 schrieb Bernhard Reutner-Fischer via Gcc-patches:

>> diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
>> index 53c760a6c38..cde34c67482 100644
>> --- a/gcc/fortran/symbol.c
>> +++ b/gcc/fortran/symbol.c

>> @@ -5052,7 +5052,7 @@ gfc_get_typebound_proc (gfc_typebound_proc *tb0)
>>   
>>     result = XCNEW (gfc_typebound_proc);
>>     if (tb0)
>> -    *result = *tb0;
>> +    memcpy (result, tb0, sizeof (gfc_typebound_proc));;
>>     result->error = 1;
>>   
>>     latest_undo_chgset->tbps.safe_push (result);
> 
> 

please forgive me, but frankly speaking, I don't like this change.

It seems to serve no obvious purpose other than obfuscating the code
and defeating the compiler's ability to detect type mismatches.

I would not have OKed that part of the patch.

Harald



More information about the Gcc-patches mailing list