[petsc-dev] Use -Wshadow on pipelines?
Barry Smith
bsmith at petsc.dev
Sun Aug 9 21:12:00 CDT 2020
Agree
> On Aug 9, 2020, at 6:55 PM, Jacob Faibussowitsch <jacob.fai at gmail.com> wrote:
>
> Hello All,
>
> I discovered a rather obscure set of compiler flags -Wshadow, -Wshadow=local, -Wshadow=compatible-local while trying to track down a bug which warn about local redefinition of a variable. Out of curiosity I also recompiled petsc with this flag and lo and behold the src is littered with shadowed variables. From what I can tell most are likely harmless — defining an iterator variable in the beginning of the function with all the rest of the variables, then redefining it later in some loop — but maybe we should consider adding this as a CI flag as it isn’t activated by -Wall.
>
> Best regards,
>
> Jacob Faibussowitsch
> (Jacob Fai - booss - oh - vitch)
> Cell: (312) 694-3391
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20200809/a857d059/attachment.html>
More information about the petsc-dev
mailing list