output_docbook.cpp warnings for comparison of different signedness
Scott Kostyshak
skostysh at lyx.org
Mon Nov 30 16:19:43 UTC 2020
On Mon, Nov 30, 2020 at 11:16:27AM -0500, Richard Kimberly Heck wrote:
> On 11/29/20 11:24 PM, Scott Kostyshak wrote:
> > I get the following warnings:
> >
> > /home/scott/lyxbuilds/master/repo/src/output_docbook.cpp: In function ‘void lyx::{anonymous}::makeParagraph(const lyx::Text&, const lyx::Buffer&, lyx::XMLStream&, const lyx::OutputParams&, const const_iterator&)’:
> > /home/scott/lyxbuilds/master/repo/src/output_docbook.cpp:357:26: error: comparison of integer expressions of different signedness: ‘long int’ and ‘long unsigned int’ [-Werror=sign-compare]
> > 357 | special_case |= nInsets == parSize && std::all_of(par->insetList().begin(), par->insetList().end(), [](InsetList::Element inset) {
> > | ~~~~~~~~^~~~~~~~~~
> > /home/scott/lyxbuilds/master/repo/src/output_docbook.cpp:378:26: error: comparison of integer expressions of different signedness: ‘long int’ and ‘long unsigned int’ [-Werror=sign-compare]
> > 378 | special_case |= nInsets == parSize && std::all_of(par->insetList().begin(), par->insetList().end(), isLyxCodeSpecialCase);
> > | ~~~~~~~~^~~~~~~~~~
> > /home/scott/lyxbuilds/master/repo/src/output_docbook.cpp: In lambda function:
> > /home/scott/lyxbuilds/master/repo/src/output_docbook.cpp:401:17: error: comparison of integer expressions of different signedness: ‘long int’ and ‘long unsigned int’ [-Werror=sign-compare]
> > 401 | if (nInsets != parSize)
> > | ~~~~~~~~^~~~~~~~~~
> > /home/scott/lyxbuilds/master/repo/src/output_docbook.cpp: In function ‘void lyx::{anonymous}::makeParagraph(const lyx::Text&, const lyx::Buffer&, lyx::XMLStream&, const lyx::OutputParams&, const const_iterator&)’:
> > /home/scott/lyxbuilds/master/repo/src/output_docbook.cpp:412:26: error: comparison of integer expressions of different signedness: ‘long int’ and ‘long unsigned int’ [-Werror=sign-compare]
> > 412 | special_case |= nInsets == parSize && std::all_of(par->insetList().begin(), par->insetList().end(), isFlexSpecialCase);
> > | ~~~~~~~~^~~~~~~~~~
>
> There are bazillions of these, scattered throughout the code. I've had a
> serious look at some of them, a less serious look at others. For now,
> you may well be best just to suppress them.
Strange. For me, I could compile without error using -Werror one or two days ago. I tested with -Werror with both GCC and Clang and both worked.
Only in the last day did compilation fail because of the above warnings.
Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20201130/d912e770/attachment.asc>
More information about the lyx-devel
mailing list