Bug 387299 - conditional expression is constant warnings for CartesianPlot.cpp
Summary: conditional expression is constant warnings for CartesianPlot.cpp
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: backend (other bugs)
Version First Reported In: latest
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-25 15:15 UTC by uwestoehr
Modified: 2017-12-05 21:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 2.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uwestoehr 2017-11-25 15:15:33 UTC
I get:

1>C:\CraftRoot\labplot\src\backend\worksheet\plots\cartesian\CartesianPlot.cpp(1358): warning C4127: conditional expression is constant
1>C:\CraftRoot\labplot\src\backend\worksheet\plots\cartesian\CartesianPlot.cpp(1367): warning C4458: declaration of 'd' hides class member
1>  C:\CraftRoot\labplot\src\backend/core/AbstractAspect.h(184): note: see declaration of 'AbstractAspect::d'
1>C:\CraftRoot\labplot\src\backend\worksheet\plots\cartesian\CartesianPlot.cpp(1376): warning C4127: conditional expression is constant
1>C:\CraftRoot\labplot\src\backend\worksheet\plots\cartesian\CartesianPlot.cpp(1388): warning C4458: declaration of 'd' hides class member
1>  C:\CraftRoot\labplot\src\backend/core/AbstractAspect.h(184): note: see declaration of 'AbstractAspect::d'
1>C:\CraftRoot\labplot\src\backend\worksheet\plots\cartesian\CartesianPlot.cpp(1397): warning C4127: conditional expression is constant
1>C:\CraftRoot\labplot\src\backend\worksheet\plots\cartesian\CartesianPlot.cpp(1405): warning C4458: declaration of 'd' hides class member
1>  C:\CraftRoot\labplot\src\backend/core/AbstractAspect.h(184): note: see declaration of 'AbstractAspect::d'
1>C:\CraftRoot\labplot\src\backend\worksheet\plots\cartesian\CartesianPlot.cpp(1414): warning C4127: conditional expression is constant
Comment 1 uwestoehr 2017-12-05 00:16:35 UTC
I get additionally also this:

1>C:\CraftRoot\labplot\src\backend\worksheet\plots\cartesian\CartesianPlot.cpp(129): warning C4305: '=': truncation from 'double' to 'float'
Comment 2 Alexander Semke 2017-12-05 21:49:55 UTC
Git commit 9e63f4b57a8576f451e29cd2dbd1d7ecefb8774f by Alexander Semke.
Committed on 05/12/2017 at 21:48.
Pushed by asemke into branch 'master'.

Removed obsolete asserts and fixed initialization of a float.
FIXED-IN: 2.5

M  +1    -5    src/backend/worksheet/plots/cartesian/CartesianPlot.cpp

https://commits.kde.org/labplot/9e63f4b57a8576f451e29cd2dbd1d7ecefb8774f
Comment 3 Alexander Semke 2017-12-05 21:53:48 UTC
C4458 warning seems to be wrong here since the class member 'd' in AbstractAspect.h(184) is declared private and cannot be overwritten by any local parameters declared in functions of derived classes.

Our msvc-build is full of these warning at the moment because of this overwritten private member in AbstractAspect. Let's ignore this for a moment.