Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 588772 - games-action/xbomber-101: fails to compile with clang-3.7.1
Summary: games-action/xbomber-101: fails to compile with clang-3.7.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2016-07-13 18:39 UTC by Austin English (RETIRED)
Modified: 2016-07-27 16:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compile log (compile.txt,34.65 KB, text/plain)
2016-07-13 18:39 UTC, Austin English (RETIRED)
Details
ebuild diff (diff.txt,1.59 KB, patch)
2016-07-13 18:44 UTC, Austin English (RETIRED)
Details | Diff
proper repo patch (0001-games-action-xbomber-fix-building-with-Clang.patch,3.71 KB, patch)
2016-07-13 18:45 UTC, Austin English (RETIRED)
Details | Diff
add a patch making those functions void (0001-games-action-xbomber-fix-building-with-clang.patch,6.14 KB, patch)
2016-07-13 22:05 UTC, Austin English (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Austin English (RETIRED) gentoo-dev 2016-07-13 18:39:52 UTC
Created attachment 440610 [details]
compile log

There are several errors like:
bomber.c:2432:3: error: non-void function 'domode4' should return a value
      [-Wreturn-type]
                return;

adding -Wno-return-type when compiling with clang avoids the issue, I'll attach a patch for review.
Comment 1 Austin English (RETIRED) gentoo-dev 2016-07-13 18:44:26 UTC
Created attachment 440612 [details, diff]
ebuild diff
Comment 2 Austin English (RETIRED) gentoo-dev 2016-07-13 18:45:18 UTC
Created attachment 440614 [details, diff]
proper repo patch

@Games, please review. If there's no comment/problem, I'll commit in two weeks.
Comment 3 Tristan Heaven (RETIRED) gentoo-dev 2016-07-13 19:18:40 UTC
This seems more like a workaround than a fix. The code would be wrong no matter which compiler you're using, so it'd be better to patch it unconditionally.

Proper fix would be to either put an appropriate return value in, or change the function return type to void.
Comment 4 Austin English (RETIRED) gentoo-dev 2016-07-13 21:28:36 UTC
(In reply to Tristan Heaven from comment #3)
> This seems more like a workaround than a fix. The code would be wrong no
> matter which compiler you're using, so it'd be better to patch it
> unconditionally.
> 
> Proper fix would be to either put an appropriate return value in, or change
> the function return type to void.

Yes. I started to patch it, but it's not completely clear (to me) what was intended in some places. Given that upstream is dead, there's no real way to fix this properly, or to have the original author verify the changes are correct.
Comment 5 Austin English (RETIRED) gentoo-dev 2016-07-13 22:05:32 UTC
Created attachment 440644 [details, diff]
add a patch making those functions void

The void approach rather than adding return codes was easier, thanks for suggestion.
Comment 6 Tristan Heaven (RETIRED) gentoo-dev 2016-07-14 00:13:00 UTC
Much better
Comment 7 Austin English (RETIRED) gentoo-dev 2016-07-15 04:40:01 UTC
(In reply to Tristan Heaven from comment #6)
> Much better

Is that OK to commit?