Skip to content
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

remove extraneous parentheses #13

Merged
merged 1 commit into from Feb 1, 2023

Conversation

MichaelChirico
Copy link

These are throwing a compiler warning on -Wparentheses-equality

These are throwing a compiler warning on -Wparentheses-equality
gaborcsardi added a commit that referenced this pull request Sep 27, 2022
Following lpSolveAPI.

Original error:
```
> ### Name: lp
> ### Title: Linear and Integer Programming
> ### Aliases: lp
> ### Keywords: optimize
>
> ### ** Examples
>
> #
> # Set up problem: maximize
> #   x1 + 9 x2 +   x3 subject to
> #   x1 + 2 x2 + 3 x3  <= 9
> # 3 x1 + 2 x2 + 2 x3 <= 15
> #
> f.obj <- c(1, 9, 1)
> f.con <- matrix (c(1, 2, 3, 3, 2, 2), nrow=2, byrow=TRUE)
> f.dir <- c("<=", "<=")
> f.rhs <- c(9, 15)
> #
> # Now run.
> #
> lp ("max", f.obj, f.con, f.dir, f.rhs)
lp_presolve.c:193:34: runtime error: applying non-zero offset 16 to null pointer
    #0 0x7f9ffc9213db in presolve_rebuildUndo /data/gannet/ripley/R/packages/tests-clang-SAN/lpSolve/src/lp_presolve.c:193:34
    #1 0x7f9ffc988821 in postsolve /data/gannet/ripley/R/packages/tests-clang-SAN/lpSolve/src/lp_presolve.c:5620:5
    #2 0x7f9ffc9fcbff in spx_solve /data/gannet/ripley/R/packages/tests-clang-SAN/lpSolve/src/lp_simplex.c:2062:9
    #3 0x7f9ffc9fe260 in lin_solve /data/gannet/ripley/R/packages/tests-clang-SAN/lpSolve/src/lp_simplex.c:2154:12
    #4 0x7f9ffca13511 in lpslink /data/gannet/ripley/R/packages/tests-clang-SAN/lpSolve/src/lpslink56.c:377:25
    #5 0x74ef88 in do_dotCode /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c
    #6 0x83f0a5 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7126:14
    #7 0x829ade in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:748:8
    #8 0x891fd3 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c
    #9 0x88dc7f in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1844:16
    #10 0x82a518 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:871:12
    #11 0x95ade6 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264:2
    #12 0x95e340 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:316:11
    #13 0x95e149 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1194:5
    #14 0x95e482 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1201:5
    #15 0x4f30ba in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29:5
    #16 0x7fa00c1cab74 in __libc_start_main (/lib64/libc.so.6+0x27b74) (BuildId: 08df60634339b221bb854d4e10b7278cafde70c4)
    #17 0x43231d in _start (/data/gannet/ripley/R/R-clang-SAN/bin/exec/R+0x43231d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior lp_presolve.c:193:34 in
Success: the objective function is 40.5
```
@gaborcsardi
Copy link
Owner

Thanks!

@gaborcsardi gaborcsardi merged commit a22a553 into gaborcsardi:main Feb 1, 2023
@MichaelChirico MichaelChirico deleted the patch-2 branch February 1, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants