Re: Fwd: [glennrp/libpng] Apple clang 8.1.0 warnings (#156)
John Bowler <[email protected]>
| Newsgroups | gmane.comp.graphics.png.devel |
|---|---|
| Message-ID | <CAP7U398XHApwu+P8BowsEr2LO29OY9n9k30ybAr--jCRgUo7fQ@mail.gmail.com> |
Yep, the original "Norcroft" ARM C compiler did this for a while, the message was "warning no side effect in void context". That was the 90's Plus ca change, plus ca meme chose. John Bowler On Wed, Mar 29, 2017 at 11:02 AM, Glenn Randers-Pehrson <[email protected]> wrote: > New libpng warnings. I don't know why clang is objecting to > what seems to be valid use of the comma. The warning messages > hint that using "(void)" would suppress the warnings. > > I suspect that in most cases the warning could also be suppressed > by using semicolons instead of commas, and adding braces > if necessary, as in > > if (test <= DBL_MAX) > { > ++exp_b10; base=test; > } > > in place of > > if (test <= DBL_MAX) > ++exp_b10, base = test; > > Glenn > > ---------- Forwarded message ---------- > From: Viktor Szakats <notifications-9UaJU3cA/F/[email protected]> > Date: Wed, Mar 29, 2017 at 5:56 AM > Subject: [glennrp/libpng] Apple clang 8.1.0 warnings (#156) > To: glennrp/libpng <[email protected]> > Cc: Subscribed <[email protected]> > > > After this week's toolchain updates, the following, mostly -Wcomma > warnings appeared. Also included some existing const stripping warnings. > This is so when building libpng with -Weverything option, I haven't > tested with other warning levels. Anyhow some of these *may* be useful > information. > > png.c:2835:16: warning: possible misuse of comma operator here [-Wcomma] > recip = 1, power = -power; > ^ > png.c:2835:7: note: cast expression to void to silence warning > recip = 1, power = -power; > ^~~~~~~~~ > (void)( ) > png.c:2913:25: warning: possible misuse of comma operator here [-Wcomma] > ++exp_b10, base = test; > ^ > png.c:2913:16: note: cast expression to void to silence warning > ++exp_b10, base = test; > ^~~~~~~~~ > (void)( ) > > [snip] > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > png-mng-implement mailing list > png-mng-implement-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/png-mng-implement > > -- John Bowler <[email protected]> +1 (541) 450-9885 PO BOX 3151 KERBY OR 97531-3151 USA ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ png-mng-implement mailing list png-mng-implement-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/png-mng-implement