Opened 3 years ago

Closed 3 years ago

Last modified 3 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


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@…> 3 years ago.
patch changing abs to llabs
0001-transcode-abs-to-qabs.patch (1.3 KB) - added by Gary Buhrmaster <gary.buhrmaster@…> 3 years ago.

Download all attachments as: .zip

Change History (8)

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

patch changing abs to llabs

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

This issue was discussed in

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 3 years ago by Gary Buhrmaster <gary.buhrmaster@…>

comment:2 Changed 3 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 3 years ago by beirdo

  • Milestone changed from 0.26 to unknown
  • Type changed from Patch - Bug Fix to Patch - Feature

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

comment:4 Changed 3 years ago by danielk

  • Owner set to beirdo
  • Status changed from new to assigned

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 3 years ago by Gavin Hurlbut <ghurlbut@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

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 3 years ago by beirdo

  • Milestone changed from unknown to 0.26

Add Comment

Modify Ticket

as closed The owner will remain beirdo.
The resolution will be deleted. Next status will be 'new'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.