-
Notifications
You must be signed in to change notification settings - Fork 91
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
Fix compiler warnings about uninitialised variables and issue #15 #58
Conversation
dpr1fact.c
Outdated
@@ -365,7 +365,7 @@ char dodpr1fact(double *beta, mwIndex *perm, double *d, double t, const double * | |||
------------------------------------------------------------ */ | |||
else{ | |||
psqrdep = 0.0; | |||
for(i = 0; dep[i] < m; i++) | |||
for(i = 0, j = 0; dep[i] < m; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this change. Please set j
in a separate line before for clarity.
install_sedumi.m
Outdated
flags{end+1} = '-Wno-unused-variable'; | ||
flags{end+1} = '-Wno-unused-but-set-variable'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously not supported by clang (macOS) https://travis-ci.org/github/sqlp/sedumi/jobs/718183038
Is it too difficult to remove the unused variables as well? Then those flags are not needed.
Thank you for your effort @robertgj . I reviewed your changes and suggest two changes. |
Respond to siko1056 requested changes |
Thank you again @robertgj for your changes. The reason for the macOS buildbot to fail is OpenMathLib/OpenBLAS#2783 and is no blocker for the merge. Just one question before I merge: Where is the macro |
I'm afraid I don't have access to MATLAB. Add -DMEX_DEBUG in the mex template to enable mxAssert checks when compiling MATLAB with install_sedumi.m. |
Having a closer look at it, I am convinced introducing the definition Can you strip your second commit (3d0e453) and just care about my two assertions for the first commit (313c7d2)?
Sorry, I don't want to delay things unnecessary, but quick fixes now are painful to deal with later. |
This reverts commit 3d0e453. Revert changes as requested by siko1056
Revert previous change to robertgj/sedumi as requested by siko1056. I am not sure what is happening with examples/README.md and examples/test_sedumi.m. They are the same in my clones of robertgj/sedumi and sqlp/sedumi.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes look good, I care about the files I changed in the "examples" directory, if things go wrong.
Fix compiler warnings about uninitialised variables.
Fix issue results are not apparently deterministic? #15 "results are not apparently deterministic?" in blkchol2.c:
--- sedumi/blkchol2.c 2020-08-15 23:10:22.858943847 +1000
+++ SeDuMi_1_3/blkchol2.c 2020-08-15 23:09:49.000000000 +1000
@@ -113,7 +113,7 @@
------------------------------------------------------- /
xkk = x[inz];
if(xkk > lb[k]){ / now xkk > 0 */
NOTE4: SeDuMi in Github (2014-08-14) has two bugs to use it. We list
two modifications of SeDuMi:
(1) Remove % in the head of the 792nd line in sedumi.m
(2) Replace the 77th line in eigK.m by
lab(li+1:li+nl) = x(xi+1:xi+nl);