aboutsummaryrefslogtreecommitdiff
path: root/gcc/genhooks.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2021-06-06 11:37:45 +0200
committerEric Botcazou <ebotcazou@adacore.com>2021-06-06 11:41:30 +0200
commita589877a0036fc2f66b7a957859940c53efdc7c9 (patch)
treea6bc26893ec860b9b4411e2ef71520937c894b14 /gcc/genhooks.c
parent28c62475050d2ac6c243580e1130a87308e1e907 (diff)
downloadgcc-a589877a0036fc2f66b7a957859940c53efdc7c9.zip
gcc-a589877a0036fc2f66b7a957859940c53efdc7c9.tar.gz
gcc-a589877a0036fc2f66b7a957859940c53efdc7c9.tar.bz2
Fix thinko in new warning on type punning for storage order purposes
In C, unlike in Ada, the storage order of arrays is that of their component type, so you need to look at it when deciding to warn. And the PR complains about a bogus warning on the assignment of a pointer returned by alloca or malloc, so this also fixes that. gcc/c PR c/100920 * c-decl.c (finish_struct): Fix thinko in previous change. * c-typeck.c (convert_for_assignment): Do not warn on pointer assignment and initialization for storage order purposes if the RHS is a call to a DECL_IS_MALLOC function. gcc/testsuite/ * gcc.dg/sso-14.c: New test.
Diffstat (limited to 'gcc/genhooks.c')
0 files changed, 0 insertions, 0 deletions