Re: avr-gcc-12.1.0-x64-windows new warnings ?
Senthil Kumar <[email protected]> Mon, 24 Apr 2023 11:16:23 +0530
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <CABvNLJsnJCZTWJpYoN+pLT3uuRDnAp1F91YGb3NSUp0rEmkxRw@mail.gmail.com> |
--00000000000096a1aa05fa0e8794 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 24, 2023 at 2:28=E2=80=AFAM Royce Pereira <[email protected]> w= rote: > Hi, > > I just tried avr-gcc 12.1.0 on an old project, and got some new warning I > can't explain. > > The code is: > > PORTC &=3D 0xFE ; //clear bit 0. > > and the warning is: > warning: array subscript 0 is outside array bounds of 'volatile > uint8_t[0]' {aka 'volatile unsigned char[]'} [-Warray-bounds] > > What is this warning and what array is it referring to? > Presumably from the macro expansion of PORTC? Can you paste the full command line? Also, can you add -E to the command line and share the output? Regards Senthil > > Thank you! > > -- > Best Regards, > > -- Royce Pereira > --00000000000096a1aa05fa0e8794 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">= <div dir=3D"ltr" class=3D"gmail_attr">On Mon, Apr 24, 2023 at 2:28=E2=80=AF= AM Royce Pereira <<a href=3D"mailto:[email protected]">[email protected]= </a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:= 0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">= <div dir=3D"ltr">Hi,<div><br></div><div>I just tried avr-gcc 12.1.0 on an o= ld project, and got some new warning I can't explain.</div><div><br></d= iv><div>The code is:</div><div><br></div><div>PORTC &=3D 0xFE ;=C2=A0 /= /clear bit 0.<br></div><div><br></div><div>and the warning is:</div><div>wa= rning: array subscript 0 is outside array bounds of 'volatile uint8_t[0= ]' {aka 'volatile unsigned char[]'} [-Warray-bounds]<br></div><= div><br></div><div>What is this warning and what array is it referring=C2= =A0to?</div></div></blockquote><div>Presumably from the macro expansion of = PORTC?</div><div>Can you paste the full command line? Also, can you add -E = to the command line and share the output?</div><div><br></div><div>Regards<= /div><div>Senthil <br></div><blockquote class=3D"gmail_quote" style=3D"marg= in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e= x"><div dir=3D"ltr"><div><br></div><div>Thank you!</div><div><br></div><spa= n>-- </span><br><div dir=3D"ltr"><div dir=3D"ltr">Best Regards,<div><br></d= iv><div>-- Royce Pereira</div></div></div></div> </blockquote></div></div> --00000000000096a1aa05fa0e8794--