Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10915 closed Patch - Feature (fixed)

Compile of abs(long long) fails on ARM processor

Reported by: parrisimo@… Owned by: beirdo
Priority: minor Milestone: 0.26
Component: MythTV - Mythtranscode Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Error: transcode.cpp:541: error: call of overloaded 'abs(long long int)' is ambiguous

Fix: Changing abs to llabs allows the compile to be successful.

Info: Another user reported a similar problem on Ticket 1885, but fixed problem by adding special function MyAbs?. I don't know which solution is preferred by the developers.

Attachments (2)

transcode.cpp.diff (586 bytes) - added by m Parris <parrisimo@…> 12 years ago.
patch changing abs to llabs
0001-transcode-abs-to-qabs.patch (1.3 KB) - added by Gary Buhrmaster <gary.buhrmaster@…> 12 years ago.

Download all attachments as: .zip

Change History (8)

Changed 12 years ago by m Parris <parrisimo@…>

Attachment: transcode.cpp.diff added

patch changing abs to llabs

comment:1 Changed 12 years ago by Gary Buhrmaster <gary.buhrmaster@…>

This issue was discussed in http://www.gossamer-threads.com/lists/mythtv/dev/522106

I agree with Lawrence Rust regarding compiler/platform idiosyncratic behaviors, and would instead suggest that using the Qt function here is likely to be the most portable solution. Attached is an alternative patch using qAbs (all uses of abs changed).

Changed 12 years ago by Gary Buhrmaster <gary.buhrmaster@…>

comment:2 Changed 12 years ago by beirdo

At this time, we do not specifically support ARM processors. What platform are you compiling for, and with what compiler tools versions, etc?

With no way to verify this, it's probably not going to be immediately viewed as terribly high priority as we have too many other platforms to support as it is. However, it would be nice to get it working.

comment:3 Changed 12 years ago by beirdo

Milestone: 0.26unknown
Type: Patch - Bug FixPatch - Feature

Kinda a feature request... Anyways, please do not set the milestone.

comment:4 Changed 12 years ago by danielk

Owner: set to beirdo
Status: newassigned

Gavin, I think qAbs() makes sense for long long, due to current state of flux with long long in C99 vs C++03 vs C++11. i.e. it is required in C99 and C++11, but not in C++03 which is our current minimum C++.

comment:5 Changed 12 years ago by Gavin Hurlbut <ghurlbut@…>

Resolution: fixed
Status: assignedclosed

In 13163358dd54687628233ce4285f09435c0066c2/mythtv:

Remove the use of abs(long long) as it freaks out ARM compilers

Rather than using qAbs or llabs, it's simple enough in the specific situations
to just avoid using abs() altogether.

Fixes #10915

comment:6 Changed 12 years ago by beirdo

Milestone: unknown0.26
Note: See TracTickets for help on using tickets.