rqtl / qtl2

QTL analysis software for high-dimensional data and complex cross designs
https://kbroman.org/qtl2
GNU General Public License v3.0
34 stars 23 forks source link

Compiler warning about function call in brent's method #169

Open kbroman opened 4 years ago

kbroman commented 4 years ago

Compiler on CRAN is giving this warning:

brent_fmin.cpp:156:10: runtime error: call to function negLL(double, calcLL_args*) through pointer
     to incorrect function type 'double (*)(double, void *)'
kbroman commented 4 years ago

This seems identical to what's in optimize.c in the R stats package.

kbroman commented 3 years ago

I'm going to close this and not fix it; CRAN seems to be allowing the warning.

kbroman commented 3 years ago

I think I can add a function attribute to avoid this warning, and so I’ll re-open the issue. See clang documentation.

kbroman commented 3 years ago

Seems like the following docker container is just want I need for testing: rocker/r-devel-ubsan-clang

(Seems like you need to re-build it, and that you need to replace llvm-7 with llvm-12 in the Dockerfile.)

kbroman commented 3 years ago

Ugh; I can't figure out the appropriate way to use this __attribute__((no_sanitize("undefined"))) business. Since I'm only making one call to brent_fmin(), I might just hard-code the function arguments.