Bug 1175667

Summary: "./Setup configure --ghc-option=-optc-Wall" gives "warning: control reaches end of non-void function [-Wreturn-type]"
Product: [Fedora] Fedora Reporter: Jens Petersen <petersen>
Component: ghc-rpm-macrosAssignee: Jens Petersen <petersen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: haskell-devel, petersen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ghc-rpm-macros-1.2.19-1.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-20 08:33:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jens Petersen 2014-12-18 10:19:58 UTC
Description of problem:
After adding CFLAGS to %cabal_configure build.log's now include

+ ./Setup configure --prefix=/usr --libdir=/usr/lib64 --docdir=/usr/share/doc/cabal-rpm '--libsubdir=$compiler/$pkgid' '--datasubdir=$pkgid' --ghc --enable-executable-dynamic '--ghc-options= -optc-O2 -optc-g -optc-pipe -optc-Wall -optc-Werror=format-security -optc-Wp,-D_FORTIFY_SOURCE=2 -optc-fexceptions -optc-fstack-protector-strong -optc--param=ssp-buffer-size=4 -optc-grecord-gcc-switches -optc-m64 -optc-mtune=generic  -optl-Wl,-z,relro'
Configuring cabal-rpm-0.9.2...
/tmp/18846.c: In function 'foo':
/tmp/18846.c:1:1:
     warning: control reaches end of non-void function [-Wreturn-type]
     int foo() {}
     ^

This caused by -Wall and something in Cabal I guess.
Grepping the Cabal source only shows up:

./Distribution/Simple/GHC.hs:362:               hPutStrLn testchnd "int foo() { return 0; }"

Version-Release number of selected component (if applicable):
ghc-rpm-macros-1.2.17-1.fc21
ghc-rpm-macros-1.3.9-1.fc22

Steps to Reproduce:
1. build Fedora Haskell package Cabal-based package 

Actual results:
:
warning: control reaches end of non-void function [-Wreturn-type]
:

Expected results:
no warning

Additional info:
Should probably report this upstream.

It can be reproduced by:

./Setup configure --ghc-option=-optc-Wall

Comment 1 Jens Petersen 2014-12-18 10:21:55 UTC
Looks like this is fixed with Cabal-1.18 (ghc-7.8.3+)
but happens with ghc-7.6.3 Cabal.

Comment 2 Jens Petersen 2014-12-19 03:58:08 UTC
Moving to F21 since this will not affect ghc-7.8.

Comment 3 Fedora Update System 2015-01-19 06:05:58 UTC
ghc-rpm-macros-1.2.18-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/ghc-rpm-macros-1.2.18-1.fc21

Comment 4 Fedora Update System 2015-01-20 21:04:45 UTC
Package ghc-rpm-macros-1.2.18-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ghc-rpm-macros-1.2.18-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-0932/ghc-rpm-macros-1.2.18-1.fc21
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2015-01-22 08:29:08 UTC
ghc-rpm-macros-1.2.19-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/ghc-rpm-macros-1.2.19-1.fc21

Comment 6 Fedora Update System 2015-02-20 08:33:39 UTC
ghc-rpm-macros-1.2.19-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.