Bug 314528 - On i386 system, it doesn't compile
Summary: On i386 system, it doesn't compile
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Unclassified
Component: Playlists/Automated Playlist Generator (show other bugs)
Version: 2.7.0
Platform: FreeBSD Ports FreeBSD
: NOR grave (vote)
Target Milestone: 2.8
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 15:55 UTC by Luca Pizzamiglio
Modified: 2013-05-15 12:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.7.1


Attachments
Adding the suffix on 64 bit integer constant (561 bytes, patch)
2013-02-06 15:56 UTC, Luca Pizzamiglio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Pizzamiglio 2013-02-06 15:55:05 UTC
When I build Amarok on i386 I get a compile error:
/usr/ports/audio/amarok-kde4/work/amarok-2.7.0/src/playlistgenerator/constraints/PlaylistFileSize.cpp:175:
error: integer constant is too large for 'long' type

A 64bit integer number is used without the LL suffix

Reproducible: Always

Steps to Reproduce:
1. compile using a FreeBSD on i386
2.
3.
Actual Results:  
Adding the right suffix, the problem is solved.
Comment 1 Luca Pizzamiglio 2013-02-06 15:56:03 UTC
Created attachment 76946 [details]
Adding the suffix on 64 bit integer constant
Comment 2 Myriam Schweingruber 2013-02-06 16:11:03 UTC
Very strange, why did none of the distributions report that? Apparently it does build on Linux i386 systems without problems.
Comment 3 Luca Pizzamiglio 2013-02-06 17:13:48 UTC
(In reply to comment #2)
> Very strange, why did none of the distributions report that? Apparently it
> does build on Linux i386 systems without problems.

I guess, it's related with the old gcc version (4.2.x)  FreeBSD still uses and some automatic conversion that a newer gcc adopts.
Comment 4 Myriam Schweingruber 2013-02-06 17:20:04 UTC
Right, then I would suggest to update the Gcc version instead of asking Amarok to be compliant with outdated compilers, current is 4.7.2, your version was released over 5 years ago.
Comment 5 Luca Pizzamiglio 2013-02-06 18:23:44 UTC
(In reply to comment #4)
> Right, then I would suggest to update the Gcc version instead of asking
> Amarok to be compliant with outdated compilers, current is 4.7.2, your
> version was released over 5 years ago.

I cannot explain here all related question about what you've written, but:
* FreeBSD 8 & 9 has, as default compiler, gcc 4.2.1 because newer gcc adopts GPLv3, incompatible with the BSD license.
* FreeBSD 9 and Current (10) is moving to another compiler, clang. No problem raised with it.
* The change I'm proposing is covered by the C99 standard, so perfectly compliant with almost every new compilers. It's a minimal modification, just add the ULL or LL suffix to a number, to specify that it's a 64 bit integer. In my personal opinion, it improves readability and compatibility.
* we use, when we find a problem, to propose a patch to be integrated in the mainline, when this patch contributes to compatibility without damage the original source code (that's the case)
Comment 6 Edward Hades 2013-04-11 14:29:10 UTC
Git commit c20d7bc1698c5322cc272d37baa7016a6477b2d8 by Edward Toroshchin.
Committed on 11/04/2013 at 16:21.
Pushed by hades into branch 'master'.

Fix compilation error on gcc-4.2

Thanks Luca Pizzamiglio for pointing it out and providing a fix.

FIXED-IN: 2.8

M  +1    -0    ChangeLog
M  +5    -5    src/playlistgenerator/constraints/PlaylistFileSize.cpp

http://commits.kde.org/amarok/c20d7bc1698c5322cc272d37baa7016a6477b2d8
Comment 7 Matěj Laitl 2013-05-14 21:25:22 UTC
Git commit 3fb39f10d902826cde3f30fafd2ea2596a008b97 by Matěj Laitl, on behalf of Edward Toroshchin.
Committed on 11/04/2013 at 16:21.
Pushed by laitl into branch 'v2.7.x'.

Fix compilation error on gcc-4.2

Thanks Luca Pizzamiglio for pointing it out and providing a fix.

FIXED-IN: 2.8

M  +1    -0    ChangeLog
M  +5    -5    src/playlistgenerator/constraints/PlaylistFileSize.cpp

http://commits.kde.org/amarok/3fb39f10d902826cde3f30fafd2ea2596a008b97