🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2194

Re: this unsigned business

#2194
From: Phil Howard
Date: Fri, 02 Oct 1992 21:07
12 lines
882 bytes
friedl@mtndew.Tustin.CA.US (Stephen Friedl) writes:

>		if ( (unsigned int) vu > 100)
>			printf("value out of range!\n");

Is the presentation of "100" as a constant guaranteed to be correct, or
might it be ever so slightly better to use "100U"?  I don't have the
standard here, so I am not sure what the official impact is of comparing
an unsigned int and a signed int that happens to be in the positive range.

Maybe it's always OK.  I've never seen any case it isn't.  So would I be
overly paranoid by using "100U" for this?
Technical Details
Message-ID: <BvIIox.8C6@ux1.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!sdd.hp.com!ux1.cso.uiuc.edu!phil
References: <711@mtndew.Tustin.CA.US>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!sdd.hp.com!ux1.cso.uiuc.edu!phil
From: phil@ux1.cso.uiuc.edu (Phil Howard)
Subject: Re: this unsigned business
Message-ID: <BvIIox.8C6@ux1.cso.uiuc.edu>
Organization: University of Illinois at Urbana
References: <711@mtndew.Tustin.CA.US>
Date: Fri, 2 Oct 1992 21:07:31 GMT
Lines: 12