https://bugs.freedesktop.org/show_bug.cgi?id=109543
--- Comment #11 from Igor Gnatenko <i.gnatenko.br...@gmail.com> ---
https://www.gnu.org/software/gcc/gcc-9/porting_to.html
Block scope compound literal's lifetime
The C standard says that compound literals which occur inside of the body of a
function have automatic storage duration associated with the enclosing block.
Older GCC releases were putting such compound literals into the scope of the
whole function, so their lifetime actually ended at the end of containing
function. This has been fixed in GCC 9. Code that relied on this extended
lifetime needs to be fixed, move the compound literals to whatever scope they
need to accessible in.
struct S { int a, b; };
int foo(void) {
// The following line no longer compiles
struct S *p = &({ (struct S) { 1, 2 }; });
struct S *q;
{
q = &(struct S) { 3, 4 };
}
// This is invalid use after lifetime of the compound literal
// ended.
return q->b;
}
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev