[PATCH] gdb: change type of `general_symbol_info::m_section` to int

Tom de Vries tdevries@suse.de
Thu Sep 12 16:08:51 GMT 2024


On 9/12/24 17:02, Simon Marchi wrote:
>> -  void set_section_index (short idx)
>> +  void set_section_index (auto idx)
>>     { m_section = idx; }
> Wow, I didn't know you could do that.  Unfortunately:
> 
> /home/smarchi/src/binutils-gdb/gdb/symtab.h:610:27: error: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’ [-Werror]
> 
> So we can't use it right now.


FWIW, we could use typeof:
...
-  void set_section_index (short idx)
+  void set_section_index (typeof (m_section) idx)
...
but I'm not sure that's an improvement.

Thanks,
- Tom


More information about the Gdb-patches mailing list