]> git.ipfire.org Git - thirdparty/gcc.git/commit
Warn on type punning that toggles scalar storage order
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 26 May 2021 17:12:05 +0000 (19:12 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 26 May 2021 17:13:56 +0000 (19:13 +0200)
commit401bd4adcfda9965363b1ac3ba7e1580f15d6883
treec71b1e857c1b29bbf42ae593ede1de9fa560e61a
parent0e1fd432e9cd5a2a4703c9ef9cc61255ea22cc49
Warn on type punning that toggles scalar storage order

As documented in the manual, we do not support type punning that toggles
the scalar storage order, so this adds a warning for the case of unions.

gcc/c/
PR c/100653
* c-decl.c (finish_struct): Warn for a union containing an aggregate
field with a differing scalar storage order.
gcc/testsuite/
* gcc.dg/sso-13.c: New test.
gcc/c/c-decl.c
gcc/testsuite/gcc.dg/sso-13.c [new file with mode: 0644]