[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: monit net.c p.y validate.c
From: |
Rory Toma |
Subject: |
Re: monit net.c p.y validate.c |
Date: |
Tue, 21 Oct 2003 17:55:39 -0700 |
actually, here is the problem:
isupper is defined as:
isupper(int c);
We define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
and use it:
dest[len] = TOLOWER (src[len]);
src is a char, it needs to be:
dest[len] = TOLOWER ((int)src[len]);
This gets rid of the warning... but, what is a good way to test this?
On Tue, 2003-10-21 at 17:00, Jan-Henrik Haukeland wrote:
> Rory Toma <address@hidden> writes:
>
> > Yep. Here is the warning:
> >
> > gcc -c -g -O2 -Wall -D _REENTRANT -D_POSIX_PTHREAD_SEMANTICS
> > -I/usr/local/ssl/include -I/usr/local/ssl/include -DSOLARIS -I.
> > -I./device -I./http -I./process -I./protocols external/strftime.c -o
> > external/strftime.o
> > external/strftime.c: In function `memcpy_lowcase':
> > external/strftime.c:246: warning: subscript has type `char'
> > external/strftime.c: In function `memcpy_uppcase':
> > external/strftime.c:259: warning: subscript has type `char'
> > external/strftime.c: In function `gnu_strftime':
> > external/strftime.c:630: warning: subscript has type `char'
>
> Just cast TOUPPER and TOLOWER with char, like so:
>
> dest[len] = (char)TOLOWER (src[len]);
>
> The warning is due to the fact that dest[len] is a char but toupper()
> returns an int.
>
> Anyway, does the ping function now works for Solaris and FreeBSD?
--
Rory Toma address@hidden
VP of Run Level 9 http://www.trs80.net
Digeo Digital http://www.digeo.com
signature.asc
Description: This is a digitally signed message part