Set of array elements assigned with compound literals are not assigned with gcc-9.2 compiler

Nagaraju Mekala gnuuser.raj@gmail.com
Mon Mar 30 17:00:51 GMT 2020


On Mon, Mar 30, 2020 at 7:12 PM Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
> On Mon, 30 Mar 2020 at 13:56, Nagaraju Mekala via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
> >
> > Hello All,
> >
> > Need help in resolving the below error:
> >
> > The below code fails to assign values to a pointer variable with
> > gcc-9.2 compiler, same code works with gcc-8.2 compiler.
> >
> > #define FACE_DELAYS
> >
> > {0x0, 0x15, 0x0, 0x0, 0x34, 0x0, 0x35, 0x11, 0x15}
> >
> > #define  BUS_SPEED 9
> >
> > int temp_func()
> >
> > {
> >   u32 *a;
> >   if (<cond>)
> >      abc = (u32 [BUS_SPEED]) FACE_DELAYS;
>
> Your code is broken. See "Block scope compound literal's lifetime" at
> https://gcc.gnu.org/gcc-9/porting_to.html
Thank you so much for the link.

Thanks
Nagaraju



More information about the Gcc-help mailing list