Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 526832 - dev-python/pypax-0.8.6 with sys-devel/clang - paxmodule.c:104:3: error: non-void function 'PyInit_pax' should return a value [-Wreturn-type]
Summary: dev-python/pypax-0.8.6 with sys-devel/clang - paxmodule.c:104:3: error: non-v...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2014-10-25 23:01 UTC by Markus Ullmann
Modified: 2015-01-04 15:42 UTC (History)
4 users (show)

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


Attachments
build.log (build.log,4.88 KB, text/plain)
2014-10-25 23:01 UTC, Markus Ullmann
Details
emerge --info (emerge-info.log,4.99 KB, text/plain)
2014-10-25 23:03 UTC, Markus Ullmann
Details
Add ifdef for python3 non-void init return value (add-ifdef-for-python3-nonvoid-init.patch,432 bytes, patch)
2014-12-31 18:15 UTC, Fabio Scaccabarozzi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Ullmann 2014-10-25 23:01:51 UTC
Created attachment 387366 [details]
build.log

creating /home/tmp/portage/dev-python/pypax-0.8.6/work/elfix-0.8.6/scripts-python3_3/temp.linux-x86_64-3.3
clang -O2 -march=core2 -mtune=core2 -msse4.1 -msse4.2 -pipe -fPIC -DPTPAX=1 -DXTPAX=1 -DNEED_PAX_DECLS=1 -I/usr/include/python3.3 -c paxmodule.c -o /home/tmp/portage/dev-python/pypax-0.8.6/work/elfix-0.8.6/scripts-python3_3/temp.linux-x86_64-3.3/paxmodule.o
paxmodule.c:104:3: error: non-void function 'PyInit_pax' should return a value [-Wreturn-type]
                return;
                ^
1 error generated.
error: command 'clang' failed with exit status 1
Comment 1 Markus Ullmann 2014-10-25 23:03:12 UTC
Created attachment 387368 [details]
emerge --info
Comment 2 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2014-11-24 18:43:42 UTC
can you confirm that this happens with 0.9.0? if not we may just be able to remove the older version
Comment 3 Juan Simón 2014-11-24 19:33:07 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #2)
> can you confirm that this happens with 0.9.0? if not we may just be able to
> remove the older version

It still fails with 0.9.0:

paxmodule.c:104:3: error: non-void function 'PyInit_pax' should return a value [-Wreturn-type]
                return;
                ^
1 error generated.
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2014-11-24 21:02:11 UTC
jer, wrong maintainer btw :P
Comment 5 Anthony Basile gentoo-dev 2014-12-31 15:36:14 UTC
(In reply to Juan Simón from comment #3)
> (In reply to Matthew Thode ( prometheanfire ) from comment #2)
> > can you confirm that this happens with 0.9.0? if not we may just be able to
> > remove the older version
> 
> It still fails with 0.9.0:
> 
> paxmodule.c:104:3: error: non-void function 'PyInit_pax' should return a
> value [-Wreturn-type]
>                 return;
>                 ^
> 1 error generated.

Sorry, I'm not really supporting clang right now.  I'd like to but I don't have time.  If you have a patch, reopen and I'll add it.
Comment 6 Fabio Scaccabarozzi 2014-12-31 18:15:57 UTC
Created attachment 392798 [details, diff]
Add ifdef for python3 non-void init return value

Sorry for joining late, I am attaching the patch that fixes the issue.

The patch adds an ifdef, returning the correct value for both versions of python: - void for python 2.x
- NULL for python 3.x

I'm no python expert, I've taken the information from this article ("Module Initialization" section):
http://python3porting.com/cextensions.html
Given the little length of the code, I've implemented the first solution (#ifdefs), which follows the coding style already in use.
Comment 7 Anthony Basile gentoo-dev 2015-01-04 15:42:41 UTC
(In reply to Fabio Scaccabarozzi from comment #6)
> Created attachment 392798 [details, diff] [details, diff]
> Add ifdef for python3 non-void init return value
> 
> Sorry for joining late, I am attaching the patch that fixes the issue.
> 
> The patch adds an ifdef, returning the correct value for both versions of
> python: - void for python 2.x
> - NULL for python 3.x
> 
> I'm no python expert, I've taken the information from this article ("Module
> Initialization" section):
> http://python3porting.com/cextensions.html
> Given the little length of the code, I've implemented the first solution
> (#ifdefs), which follows the coding style already in use.

commit 9c5d66ed746deaf51033b322022b9070e0984011
Author: Fabio Scaccabarozzi <fsvm88@gmail.com>
Date:   Sun Jan 4 10:23:41 2015 -0500

    scripts/paxmodule.c: fix build with clang
    
    clang complains of a return with no NULL.
    
    X-Gentoo-Bug: 526832
    X-Gentoo-Bug-URL: https://bugs.gentoo.org/526832
    Signed-off-by: Anthony G. Basile <blueness@gentoo.org>