Compiler warning: fabs used for integer types

XMLWordPrintable

Details

• Type: Improvement
• Status: Invalid
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:

Description

Compiling results with clang in this warning:

 src/image/ImagePca.cc:393:46: note: use function 'std::abs' instead  double const delta = ::fabs(*fptr - iptr.image());  ^~~~~~  std::abs 

The obvious fix is to use std::abs instead.

Krzysztof Findeisen would it make any sense to fix this as part of your general afw cleanup?

Activity

Hide
Krzysztof Findeisen added a comment -

Partial duplicate of DM-10257, issue fixed there.

Show
Krzysztof Findeisen added a comment - Partial duplicate of DM-10257 , issue fixed there.
Hide
Russell Owen added a comment -

Krzysztof Findeisen The only warnings I saw about this were in that one file. That's the scope of this ticket. Feel free to not include the fix in your other work if you'd rather not. We can keep this a separate ticket.

Show
Russell Owen added a comment - Krzysztof Findeisen The only warnings I saw about this were in that one file. That's the scope of this ticket. Feel free to not include the fix in your other work if you'd rather not. We can keep this a separate ticket.
Hide
Krzysztof Findeisen added a comment - - edited

I had thought C++ compiler warnings (e.g., signed-unsigned comparisons) were out of scope of DM-4639. If they're not, you might want to clarify on that ticket.

I'm also not clear on the scope of this ticket – are you asking to look up every use of fabs in afw and manually check that the arguments are floats, or is it just this one call site?

Show
Krzysztof Findeisen added a comment - - edited I had thought C++ compiler warnings (e.g., signed-unsigned comparisons) were out of scope of DM-4639 . If they're not, you might want to clarify on that ticket. I'm also not clear on the scope of this ticket – are you asking to look up every use of fabs in afw and manually check that the arguments are floats, or is it just this one call site?

People

• Assignee:
Unassigned
Reporter:
Russell Owen
Watchers:
Krzysztof Findeisen, Russell Owen