-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[WIP] pedantic and many more flags for GNU compiler #662
base: dev
Are you sure you want to change the base?
[WIP] pedantic and many more flags for GNU compiler #662
Conversation
Don't think that's the case anywhere in the code, otherwise it wouldn't compile on MSVC |
It was part of gpu.cpp and for windows there was a workaround. I unified
this to std::vector which is much more clean.
|
8ab8e29
to
c194af0
Compare
This is very nice to see!
Also, how about running Coverity which is a static code analyzer on CI? |
@psychocrypt what's the rationale behind having signed time-stamps? |
@fireice-uk The reason is that int64_t is the default type used in the stl. This make sense else it would not be possible to define a negative offset i time. |
Timestamp is an absolute value and not an offset, confusion on that part is why I always use unsigned type for that. If those are the only grounds then I'm inclined to veto that part. |
@fireice-uk The offset was only a explanation by me. The reason is as I
wrote that int64_t is the type used by the c++ STL.
|
@fireice-uk do not forget that the timestamp is relative to a fixed point
int time. Only for use the offset is positive becase the point in time is
long long ago but this is not generic.
|
Given that the value is never going to be negative it only serves to confuse. I prefer the way we are doing it now. |
Than I need to cast it explicit to a unsigned what is in general wrong.
Because if I than substract two time stamps it is possible to get a
negative value which than in our case result in an unsigned underflow. The
risk should be not as high as long as our used time source is stady but it
is not clean to use a unsigned value.
|
c194af0
to
90a6236
Compare
Activate many compiler checks (pedantic, ...) for the GNU compiler to avoid side effects, undefined behaviors and increase the code quallity.
958f12c
to
686baf4
Compare
- change timer variables from `uin64_t` to `int64_t` - fix conversion issues form unsigned to signed - remove usage of non C++ variable length arrays e.g `int x[N]` where `N` is a runtime value
686baf4
to
49b53ef
Compare
I set this PR to WIP because I have still issues to get all compiling. |
Activate many compiler checks (pedantic, ...) for the GNU compiler
to avoid side effects, undefined behaviors and increase the code
quality.
uin64_t
toint64_t
int x[N]
whereN
is a runtime valueTests
@fireice-uk Do to the timer changes from
uint64_t
toint64_t
this PR can conflict with you upcoming changes. This PR should be rebased against you changes. Maybe we should merge that PR not before the Xmas release to have a longer time to test the changes within the next dev branch.