Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 22 months ago

Closed 22 months ago

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

Download all attachments as: .zip

Change History (8)

Changed 22 months ago by m Parris <parrisimo@…>

patch changing abs to llabs

comment:1 Changed 22 months 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 22 months ago by Gary Buhrmaster <gary.buhrmaster@…>

comment:2 Changed 22 months 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 22 months 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 22 months 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 22 months 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 22 months ago by beirdo

  • Milestone changed from unknown to 0.26

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


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

 
Note: See TracTickets for help on using tickets.