Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 523096 - sys-devel/dev86 with sys-devel/clang-3.4/3.5 - tok_io.c:231:6: error: non-void function 'do_control' should return a value [-Wreturn-type]
Summary: sys-devel/dev86 with sys-devel/clang-3.4/3.5 - tok_io.c:231:6: error: non-voi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2014-09-18 07:33 UTC by Fabio Scaccabarozzi
Modified: 2016-02-06 10:28 UTC (History)
0 users

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


Attachments
Fix build with clang (non-void function does not return a value) (fix-clang-nonvoid-function-should-return-a-value.patch,383 bytes, patch)
2014-09-18 07:35 UTC, Fabio Scaccabarozzi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Scaccabarozzi 2014-09-18 07:33:07 UTC
sys-devel/dev86 fails to build with clang-3.4/3.5 because of a non-void function not returning values (clang errors out on this).

Reproducible: Always

Steps to Reproduce:
1. CC="clang" CXX="clang++" emerge -1 sys-devel/dev86
2.
3.
Actual Results:  
The build fails.

Expected Results:  
The build should succeed.

I have attached a patch that fixes the issue by converting the function to void (rather than int).
I inspected the code and that function is only used in the same file that declares it (unproto/tok_io.c), which makes no use of the returned value. So, rather than fix 3 returns, fix the function declaration.
The compilation now succeeds, unfortunately there is no test suite available.
Comment 1 Fabio Scaccabarozzi 2014-09-18 07:35:14 UTC
Created attachment 384988 [details, diff]
Fix build with clang (non-void function does not return a value)

The patch applies cleanly to all available versions in portage.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-09-18 09:50:55 UTC
Please post the error message.
Comment 3 Fabio Scaccabarozzi 2014-09-18 11:16:42 UTC
Sorry, I forgot to add it.
Will remember it for the next bugs ;-)
Comment 4 David Seifert gentoo-dev 2016-02-06 10:28:13 UTC
Thanks for the patch Fabio!

commit 0a4ee8dccd9422cdc4a507c5bdd360be4802f8fd
Author: David Seifert <soap@gentoo.org>
Date:   Sat Feb 6 11:27:11 2016 +0100

    sys-devel/dev86: Include patch for building with clang
    
    Gentoo-Bug: 523096
    * EAPI=6
    * Amend patches for -p1
    * Thanks Fabio Scaccabarozzi for the patch