pit_type as unsigned

Richard Kimberly Heck rikiheck at lyx.org
Tue May 19 21:53:16 UTC 2020


On 5/19/20 5:29 PM, Jean-Marc Lasgouttes wrote:
> Le 18/05/2020 à 02:56, Richard Kimberly Heck a écrit :
>> On 5/12/20 11:47 AM, Jean-Marc Lasgouttes wrote:
>>> Le 11/05/2020 à 23:55, Richard Kimberly Heck a écrit :
>>>> On 5/11/20 7:00 AM, Jean-Marc Lasgouttes wrote: This one's a bit
>>>> weirder:
>>>>
>>>>          l_margin += bfm.signedWidth(layout.leftmargin) * 4
>>>>                       / (par.getDepth() + 4);
>>>>
>>>> Here, l_margin is an int; getDepth() returns unsigned; so the
>>>> convesion
>>>> is actually of bfm.signedWidth. Can l_margin be negative?
>>>
>>> signedWidth can be negative in theory. In this case l_margin would
>>> be negative. What does the margin say? How would I get it? -Wextra?
>>
>> QtCreator runs clang in the background with:
>>
>> -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic
>> -Wno-unused-macros -Wno-newline-eof -Wno-exit-time-destructors
>> -Wno-global-constructors -Wno-gnu-zero-variadic-macro-arguments
>> -Wno-documentation -Wno-shadow -Wno-switch-enum
>> -Wno-missing-prototypes -Wno-used-but-marked-unused
>> -Wno-old-style-cast -Wno-extra-semi-stmt
>
> A bit pedantic, isn't it?

Yes, very. You can probably turn off some of the rest. I'm not sure what
the 'positive' warning would be just to get the ones we're talking about.

Riki




More information about the lyx-devel mailing list