delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/03/14:57:36

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: "Christian Jullien" <eligis AT wanadoo DOT fr>
To: <cygwin AT sourceware DOT cygnus DOT com>
Subject: PROPOSED FIX to remove warning in 1.1.5-3 sys/types.h
Date: Fri, 3 Nov 2000 20:32:48 +0100
Message-ID: <IMEDKJHLFGIGPDAKFBKGKEMLCBAA.eligis@wanadoo.fr>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

Hi,

The following macro in sys/types.h

#  define	FD_ZERO(p)	(__extension__ (void)({ \
     int i; \
     char *__tmp = (char *)p; \
     for (i = 0; i < sizeof (*(p)); ++i) \
       *__tmp++ = 0; \
}))

raise a new warning 'signed unsigned comparison'
I suggest to replace
int i;
with unsigned int i;

A better solution should be to include stddef (for size_t) and have:
size_t i;
which is the type returned by sizeof.

But, unless I'm totaly wrong, the fastest solution is to use memset that
will be expanded inline with assembly code. Right?

regards.

Christian Jullien


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019