Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] gcc:0x81 out of range
- Date: Mon, 18 Dec 2006 13:39:05 +0900
- From: "Nguyen Vu Hung" <vuhung16plus@example.com>
- Subject: [tlug] gcc:0x81 out of range
Hello all,
Please refer to the code in the attachment.
I have compiled this function with Redhat Enterprise Linux 3, gcc 3.2.3.20 and it says:
trim.c:28: warning: comparison is always false due to limited range of data type trim.c:38: warning: comparison is always false due to limited range of data type
I *thought* this code will get compiled and run in Windows with VC6 at least, but with gcc 3.2.3, I got the warning ( as you can see ) : 0x81 is out of range.
If run properly, this code will trim UEC space but under my environment, it does not.
Any idea?
-- Best Regards, Nguyen Hung Vu vuhung16plus{remove}@example.com VIQR Standard: http://vi.i18n.kde.org/viqr.txtchar *trim(char *lpszString ) // (in) ½èÍýÂоݤÎʸ»úÎó { char *ps; // ¶õÇòʸ»ú¤ò½ü¤¤¤¿ÀèƬ char *pe; // ¶õÇòʸ»ú¤ò½ü¤¤¤¿ºÇ¸åÈø char *p; // ¥ï¡¼¥¯¥Ý¥¤¥ó¥¿ // ÀèƬ¤ò¸«¤Ä¤±¤ë for ( ps = lpszString; *ps; ps++ ) { if ( ( 0x81 == *ps ) && ( 0x40 == *( ps + 1 ) ) ) { // Á´³Ñ¥¹¥Ú¡¼¥¹ ps++; } else if ( 0x20 < *ps ) { // ¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹°Ê³°¢ªÀèƬ break; } } // ºÇ¸å¤ò¸«¤Ä¤±¤ë for ( p = pe = ps; *p; p++ ) { if ( ( 0x81 == *p ) && ( 0x40 == *( p + 1 ) ) ) { // Á´³Ñ¥¹¥Ú¡¼¥¹ p++; } else if ( 0x20 < *p ) { // ¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹°Ê³°¢ªºÇ¸åÈø? pe = p; } } // ¥³¥Ô¡¼ for ( p = lpszString; ps <= pe; ) { *p++ = *ps++; } *p = '\0'; return lpszString; } gcc trim.c trim.c:28: warning: comparison is always false due to limited range of data type trim.c:38: warning: comparison is always false due to limited range of data type
- Follow-Ups:
- Re: [tlug] gcc:0x81 out of range
- From: Darren Cook
- [tlug] Re: gcc:0x81 out of range
- From: Tobias Diedrich
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] SATA software RAID or SAS hardware RAID?
- Next by Date: Re: [tlug] gcc:0x81 out of range
- Previous by thread: Re: [tlug] VNC and security
- Next by thread: Re: [tlug] gcc:0x81 out of range
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links