X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=I/Im7VRP2CQvzEKk
	RkMFN7MKPPnXh9QzUaA6SeBwJ1UmVY0nodMwpX89YZAEHA52n+hLP8wKuS95dCob
	XbzhlWQY+Q7RE+ZX76zaNVrl28qswnhVVuUelsODncpGjTe1w13VNnyK07h9eYVg
	UDcDqVfj34Ikp6xjuX2oS0kggWM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=EaDCFDLH64/SXLsv+r+TCx
	Vs8N4=; b=jA+8piuC9k5XyLQGz9VfslpspTfTTe7KSK4uectwC0sbBK88ceXr94
	Qm9VTSzIzZua2bgg94D69Nz2mKbD+c8PjvOsDixfsUwKhI3N23vyiI1knHkIq5jv
	w+lDbIpeorgSh4tY1HopeRxnbGCBDtNbZH7zRWEsAPfYz9wAUOdWw=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_COUK,RP_MATCHES_RCVD,SPF_PASS autolearn=no version=3.3.2 spammy=pride, Hx-spam-relays-external:sk:smtp-ou, H*RU:sk:smtp-ou, HX-HELO:sk:smtp-ou
X-HELO: smtp-out-11.tiscali.co.uk
Subject: Re: bcftools error running Make after installing update 2.4.1.1 to Cygwin64
To: cygwin@cygwin.com
References: <BAY175-W14DF8CC504AF6F9213BF6CADC70@phx.gbl>
From: David Stacey <drstacey@tiscali.co.uk>
Message-ID: <56A693F5.7070000@tiscali.co.uk>
Date: Mon, 25 Jan 2016 21:30:29 +0000
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0
MIME-Version: 1.0
In-Reply-To: <BAY175-W14DF8CC504AF6F9213BF6CADC70@phx.gbl>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
X-CMAE-Envelope: MS4wfMcyH8qk0bzSgBLieGS0p9OPM9okhhKffovvAZ+jj8kX6/fUhtSyRCWBP+uPZx+4JeWP/d9lzEAfTUP1XfwV7y4+GgNY3rLB/ZkoMfZnjhlD4M0ttrje 2OxMNLvC2uDnq54gUraYJgNKARy0C4zduUZdplL4I+naXUbpT5n0KArm
X-IsSubscribed: yes

On 25/01/16 21:00, Robert May wrote:
> many warnings are given in the following text - see end for error message
>
> echo '#define BCFTOOLS_VERSION "1.3"'> version.h
> gcc -g -Wall -Wc++-compat -O2  -std=c99 -I. -Ihtslib-1.3 -DPLUGINPATH=\"/usr/local/libexec/bcftools\"  -c -o main.o main.c
> gcc -g -Wall -Wc++-compat -O2  -std=c99 -I. -Ihtslib-1.3 -DPLUGINPATH=\"/usr/local/libexec/bcftools\"  -c -o vcfindex.o vcfindex.c
> vcfindex.c: In function ‘main_vcfindex’:
> vcfindex.c:209:9: warning: implicit declaration of function ‘alloca’ [-Wimplicit-function-declaration]
>           char*idx_fname = (char*)alloca(strlen(fname) + 5);
>           ^
> vcfindex.c:209:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>           char*idx_fname = (char*)alloca(strlen(fname) + 5);

These warnings can be generated for a number of reasons. One is that the 
source code you are attempting to compile pre-dates this version of gcc. 
Another reason is that you are somehow using a combination of compiler 
switches that were never expected. A third reason is that the source 
code simply isn't well written, but the majority of Open Source 
contributors take great pride in their work.

In your case, it could be the compiler switches - see below.

> gcc -g -Wall -Wc++-compat -O2  -std=c99 -I. -Ihtslib-1.3 -DPLUGINPATH=\"/usr/local/libexec/bcftools\"  -c -o vcfcnv.o vcfcnv.c
> vcfcnv.c: In function ‘norm_prob’:
> vcfcnv.c:602:93: error: ‘M_PI’ undeclared (first use in this function)
>       return exp(-(baf-param->mean)*(baf-param->mean)*0.5/param->dev2) / param->norm / sqrt(2*M_PI*param->dev2);
>                                                                                               ^
> vcfcnv.c:602:93: note: each undeclared identifier is reported only once for each function it appears in
> vcfcnv.c: In function ‘main_vcfcnv’:
> vcfcnv.c:1349:9: warning: implicit declaration of function ‘fileno’ [-Wimplicit-function-declaration]
>           if ( !isatty(fileno((FILE *)stdin)) ) fname = "-";
>           ^
> vcfcnv.c: In function ‘norm_prob’:
> vcfcnv.c:603:1: warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^

This looks like expected behaviour to me. Specifying '-std=c99' defines 
a __STRICT_ANSI__ macro, which in turn means that mathematical constants 
like M_PI are not defined. Using '-std=gnu99' instead should work. You 
may also find that this more relaxed compiler setting doesn't generate 
so many warnings.

Dave.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

