-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Parse error when using povray built by GCC 13, no error with GCC 12 #460
Comments
I'm just another user - long with his own fork of v3.8, but I took a quick look at your scene files and the source. I don't see that you are anywhere setting an angle in a camera block. This leads me to wonder about HUGE_VAL, because - without running all the scenes with a compiler version I don't have handy - I don't see how we are getting into that conditional in .../source/parser/parser.cpp unless something is amiss with it. The official releases of POV-Ray have since V1.0 carried around this bit - now in (.../source/core/configcore.h ):
In my own fork I replaced that with:
I wanted to be sure I was getting, c++11 or later, definitions from Beyond that I am not sure... Suppose you could try compiling to particular c++ standards by setting those when you configure: ./configure -q COMPILED_BY="..." CXXFLAGS="-std=c++17" as you are perhaps defaulting to some newer standard. I usually run with c++17, but the POV-Ray source code compiles back to c++11. |
Building with gcc13 makes it fail to parse some scenes: POV-Ray/povray#460 Fixes NixOS#311017
Building with gcc13 makes it fail to parse some scenes: POV-Ray/povray#460 Fixes #311017 (cherry picked from commit dac4281)
The problem is caused by the gcc -ffast-math optimizations. This flag turns on -ffinite-math-only, which acts as a promise to the compiler that code will never use floating point infinities. HUGE_VAL get defined as +inf, often in math.h. Code in Parser::Parse_Camera does comparisons to HUGE_VAL, which the compiler treats as constant because of the above promise. Quick work-around: add add -fno-finite-math-only to CXXFLAGS during configuration. Also adding -DBOOST_BIND_GLOBAL_PLACEHOLDERS silences some Boost deprecation warnings. Better fix: rename HUGE_VAL to HUGE_FINITE_VAL throughout the source, patches attached for 3.7 and 3.8 beta 2. |
Building with gcc13 makes it fail to parse some scenes: POV-Ray/povray#460 Fixes NixOS#311017
Summary
I get "Parse Error: Viewing angle has to be smaller than 180 degrees." when using povray built by GCC 13, no error with GCC 12
POV-Ray Version
Runtime Environment
Scene
You can find the scene files in the _pov directories here https://gitlab.com/roever/toppler/-/tree/main/datafile
To render them them:
make
to build the full game, ormake _build/cross.dat _build/menu.dat _build/sprites.dat
to build only the povray scenes_build/pov.log
I can try to extract a minimal reproducer if needed.
Command Line Options
You can find the ini files in the _pov directories here https://gitlab.com/roever/toppler/-/tree/main/datafile
Expected Behavior
The scene is rendered regardless of the GCC version used to compile povray
Actual Behavior
I get "Parse Error: Viewing angle has to be smaller than 180 degrees." when povray is built with GCC 13, no error when povray is built with GCC 12
Output
Additional context
Discovered in NixOS/nixpkgs#311017
Workaround
Build povray with GCC 12.
Adding any angle to the camera also seems to work.
The text was updated successfully, but these errors were encountered: