POV-Ray : Newsgroups : povray.bugreports : update of stable branch Server Time
28 Mar 2024 07:33:46 EDT (-0400)
  update of stable branch (Message 1 to 3 of 3)  
From: Le Forgeron
Subject: update of stable branch
Date: 3 Dec 2016 03:14:14
Message: <58427ed6$1@news.povray.org>
I noticed a recent update of stable branch for boost 1.62

So far so good, but on the same line it could be kind to also update it
for the gcc 6.2 compiler family: since 6, it does not compile any more
due to the enforcement of stricter rules about type promotions

Basically

/usr/include/OpenEXR/ImfFrameBuffer.h:369:1: note:   no known conversion
for argument 1 from ‘pov_base::IOBase’ to ‘const
Imf_2_2::FrameBuffer::ConstIterator&’
base/image/openexr.cpp: In member function ‘virtual void
pov_base::OpenEXR::POV_EXR_IStream::seekg(Imath_2_2::Int64)’:
base/image/openexr.cpp:160:36: error: no match for ‘operator==’ (operand
types are ‘pov_base::IOBase’ and ‘bool’)
    if(is.seekg((unsigned long)pos) == false)


and

base/image/hdr.cpp:236:25: error: no match for ‘operator==’ (operand
types are ‘pov_base::IStream’ and ‘bool’)
   if(file->Read_Byte(b) == false)


basically, all that would be needed is something like

https://bitbucket.org/LeForgeron/povray/commits/d943647985cad23ff654abec4ecfde0f639eae4c

(an explicit bool operator in fileinputoutput.h, instead of -- or in
addition to -- the now useless operator!() )


For the time being, no problem of compilation of stable with intel nor
Clang compilers.


Post a reply to this message

From: clipka
Subject: Re: update of stable branch
Date: 3 Dec 2016 12:20:34
Message: <5842fee2$1@news.povray.org>
Am 03.12.2016 um 09:14 schrieb Le_Forgeron:

> So far so good, but on the same line it could be kind to also update it
> for the gcc 6.2 compiler family: since 6, it does not compile any more
> due to the enforcement of stricter rules about type promotions

Well, now that you have kindly let us /know/ about this issue, we can
indeed be so kind to try and solve it ;)


> base/image/openexr.cpp:160:36: error: no match for ‘operator==’ (operand
> types are ‘pov_base::IOBase’ and ‘bool’)
>     if(is.seekg((unsigned long)pos) == false)
> 
> 
> and
> 
> base/image/hdr.cpp:236:25: error: no match for ‘operator==’ (operand
> types are ‘pov_base::IStream’ and ‘bool’)
>    if(file->Read_Byte(b) == false)
> 
> 
> basically, all that would be needed is something like
> 
>
https://bitbucket.org/LeForgeron/povray/commits/d943647985cad23ff654abec4ecfde0f639eae4c
> 
> (an explicit bool operator in fileinputoutput.h, instead of -- or in
> addition to -- the now useless operator!() )

That would be a poor approach; after all, the stricter rules regarding
conversion to bool are there for a reason. A stream is not a boolean
expression, and strictly speaking the proper test should invoke the
`eof()` function.

Besides, statements like `if(EXPRESSION == true)` are tautologic
abominations anyway, and `if(EXPRESSION == false)` isn't much better;
such statements should instead be written as `if(EXPRESSION)` or
`if(!EXPRESSION)`.

Which, by the way, is also the solution to the reported problem, as
IOBase is already equipped to support the convention that `if(STREAM)`
and `if(!STREAM)` are idioms for `if(STREAM is good)` and `if(STREAM is
good)`.


Let me know where corresponding changes need to be made, and I'll see
that they're checked in. (A quick glance at `openexr.cpp` suggests that
only the one line is affected, but an equally quick glance at `hdr.cpp`
suggests that multiple lines need changing).


Post a reply to this message

From: clipka
Subject: Re: update of stable branch
Date: 3 Dec 2016 12:38:16
Message: <58430308$1@news.povray.org>
Am 03.12.2016 um 18:20 schrieb clipka:

> Which, by the way, is also the solution to the reported problem, as
> IOBase is already equipped to support the convention that `if(STREAM)`
> and `if(!STREAM)` are idioms for `if(STREAM is good)` and `if(STREAM is
> good)`.

That should of course be "... idioms for `if(STREAM is good)` and
`if(STREAM is bad)`".


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.