X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <48114B31.9060906@cwilson.fastmail.fm>
Date: Thu, 24 Apr 2008 23:08:33 -0400
From: cygwin@cwilson.fastmail.fm
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] NEW: libtool-2.2.2-2 / Updated: libltdl7-2.2.2-2
References: <announce.48038853.7090707@cwilson.fastmail.fm> <480445AC.7000005@users.sourceforge.net> <48044C3C.5060504@cwilson.fastmail.fm> <480FB2BA.208@users.sourceforge.net> <48100654.1050609@cwilson.fastmail.fm>
In-Reply-To: <48100654.1050609@cwilson.fastmail.fm>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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

Charles Wilson wrote:
> Yaakov (Cygwin Ports) wrote:
>> ./.libs/lt-foo.c:263: warning: string length `4368' is greater than the
>> length `4095' ISO C99 compilers are required to support

This one can be fixed by splitting the string into two pieces. I'm 
working on a patch for that.

>> ./.libs/lt-foo.c: In function `main':
>> ./.libs/lt-foo.c:288: warning: implicit declaration of function 
>> `_setmode'

This one is already fixed in current git.

>> ./.libs/lt-foo.c: In function `chase_symlinks':
>> ./.libs/lt-foo.c:577: warning: implicit declaration of function 
>> `realpath'
>> ./.libs/lt-foo.c:577: warning: assignment makes pointer from integer
>> without a cast

These two are the same issue...
(1) realpath() is invoked in a section of code that is #ifdef __CYGWIN__
(2) the wrapper source code unconditionally #includes stdlib.h
(3) cygwin's stdlib.h declares realpath.

...but it does so inside a #ifndef __STRICT_ANSI__ block. And -std=c99 
turns on __STRICT_ANSI__, while -std=gnu99 does not.

Posix says that realpath() will be declared if #include <stdlib.h>
Ansi says nothing about realpath(), so STRICT_ANSI requires that 
realpath is NOT declared when #include <stdlib.h>

I guess the cwrapper should add a section like this, for __CYGWIN__

#if defined __CYGWIN__
# if defined __STRICT_ANSI__
char *realpath (const char *, char *);
# endif
#endif

NOTE: usually you *want* the cwrapper to be compiled with the same 
CFLAGS that your target application needs.  OTOH, if you explicitly set 
your compatibility flags (-c99, _POSIX_C_SOURCE=200112L, -ansi, etc) 
"too low" it is possible something's going to break.

Or some pathological project could put '-Dprintf=exit' into CFLAGS.  You 
can't guard against everything.

But we ought to be compatible with c99.

--
Chuck


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

