Summary:ASTERISK-09576: [patch] C++ Compiler warning on ast_string_field_set
Reporter:Oskar Senft (osk)Labels:
Date Opened:2007-06-03 13:21:16Date Closed:2007-07-11 19:59:09
Versions:Frequency of
Environment:Attachments:( 0) 20070603__bug9866.diff.txt
Description:Again, a C++ compiler related issue:

When using the "ast_string_field_set" macro, G++ complains about a "comparison between signed and unsigned integer expressions". This is due to the macro definition of "ast_string_field_index_set" where the following assignment is made:

int __dlen__ = strlen(data);

and a few lines later a comparison is made:

__dlen__ <= strlen(__zz__)

which then causes the compiler to pritn the warning. "strlen" returns a size_t (unsigned int-something) and thus __dlen__ should be defined size_t or another unsigned int-something as well.

The same is for the definition of "ast_string_field_index_logset".

It's not (yet) an error, but also is not "nice" as the remaining code compiles without warnings.


BTW: Thanks for resolving 9830 it's working fine now!
Comments:By: Tilghman Lesher (tilghman) 2007-06-03 19:38:11

Please ensure that this patch properly suppresses the warning.

By: Oskar Senft (osk) 2007-06-04 01:38:50

Yep, that's it! Thank you!

By: Russell Bryant (russell) 2007-06-04 10:29:01

Fixed in 1.4 and trunk in revisiosn 67017 and 67018.  Thanks!