bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

its a bug - right


From: roger
Subject: its a bug - right
Date: Tue, 05 Jun 2001 19:53:54 GMT
User-agent: Xnews/M3

Using g++ vesrion 2.95.3 on sun sparc solaris 7...

Here's a function:
   int func (char *buf, int bufsize)
   {
       int i = bufsize ? -1 : bufsize - (int)strlen(buf);
       int j = bufsize ? -1 : bufsize -      strlen(buf);
   }

Now, what I see is the error:
   "warning: converting of negative value '-1' to 'unsigned int'
for the second line only - the one where I don't cast the strlen.

It looks like since strlen returns an unsigned int, g++ wants
both sides of the conditional to be unsigned int, or something like that.
Bug, right?

Thanks.
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]