[MDEV-31545] GCC 13 -Wdangling-pointer in execute_show_status() Created: 2023-06-26  Updated: 2023-08-30  Resolved: 2023-06-26

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4, 10.5, 10.6, 10.9, 10.10, 10.11, 11.0, 11.1
Fix Version/s: 10.4.31, 10.5.22, 10.6.15, 10.9.8, 10.10.6, 10.11.5, 11.0.3

Type: Bug Priority: Critical
Reporter: Marko Mäkelä Assignee: VicenČ›iu Ciorbaru
Resolution: Fixed Votes: 0
Labels: build


 Description   

GCC 13 emits a new warning for some old code from 2006:

10.4 9c0e91a27cc58d1b5076435e125c70cd277fd989

/mariadb/10.4/sql/sql_parse.cc: In function 'bool execute_show_status(THD*, TABLE_LIST*)':
/mariadb/10.4/sql/sql_parse.cc:6506:26: error: storing the address of local variable 'old_status_var' in '*thd.THD::initial_status_var' [-Werror=dangling-pointer=]
 6506 |   thd->initial_status_var= &old_status_var;

Possibly this could be fixed by allocating old_status_var from the heap. I don’t think that alloca() would help here.



 Comments   
Comment by Sergei Golubchik [ 2023-06-26 ]

fixed in 38fe266ea953

Generated at Thu Feb 08 10:24:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.