You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Alexander Shigin (JIRA)" <ji...@apache.org> on 2008/11/11 12:30:44 UTC
[jira] Updated: (THRIFT-198) condition is always true in
t_html_generator::print_doc
[ https://issues.apache.org/jira/browse/THRIFT-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander Shigin updated THRIFT-198:
------------------------------------
Description:
{code}
unsigned int index;
while ((index = doc.find_first_of("\r\n")) != string::npos) {
{code}
string::npos is -1, but index declared as unsigned. GCC 4.2.1 throws warning:
{code}
src/generate/t_html_generator.cc: In member function 'void t_html_generator::print_doc(t_doc*)':
src/generate/t_html_generator.cc:319: warning: comparison is always true due to limited range of data type
{code}
was:
{code}
unsigned int index;
while ((index = doc.find_first_of("\r\n")) != string::npos) {
{code}
string::npos is -1, but index declared as unsigned. GCC 4.2.1 throws warning:
{code}
src/generate/t_html_generator.cc: In member function 'void t_html_generator::print_doc(t_doc*)':
src/generate/t_html_generator.cc:319: warning: comparison is always true due to limited range of data type
{code}
> condition is always true in t_html_generator::print_doc
> -------------------------------------------------------
>
> Key: THRIFT-198
> URL: https://issues.apache.org/jira/browse/THRIFT-198
> Project: Thrift
> Issue Type: Bug
> Components: Compiler (General)
> Reporter: Alexander Shigin
> Priority: Minor
>
> {code}
> unsigned int index;
> while ((index = doc.find_first_of("\r\n")) != string::npos) {
> {code}
>
> string::npos is -1, but index declared as unsigned. GCC 4.2.1 throws warning:
> {code}
> src/generate/t_html_generator.cc: In member function 'void t_html_generator::print_doc(t_doc*)':
> src/generate/t_html_generator.cc:319: warning: comparison is always true due to limited range of data type
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.