[PATCH] sms-cdma-part: fix tautological-constant-compare compiler warning

Aleksander Morgado aleksander at aleksander.es
Thu Oct 26 07:30:07 UTC 2017


On Thu, Oct 26, 2017 at 4:00 AM, Ben Chan <benchan at chromium.org> wrote:
> From: "Luis A. Lozano" <llozano at google.com>
>
> This patch fixes the following compiler warning issued by clang:
>
>   mm-sms-part-cdma.c:301:46: mcomparison 'guint8' (aka 'unsigned char') <= 255 is always true
>   [-Werror,-Wtautological-constant-compare]

Pushed, thanks.

> ---
>  src/mm-sms-part-cdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mm-sms-part-cdma.c b/src/mm-sms-part-cdma.c
> index 167eda83..5379c58b 100644
> --- a/src/mm-sms-part-cdma.c
> +++ b/src/mm-sms-part-cdma.c
> @@ -298,7 +298,7 @@ cause_code_to_delivery_state (guint8 error_class,
>      else if (cause_code == 101)
>          /* 101 reserved */
>          delivery_state += CAUSE_CODE_GENERAL_PROBLEM_OTHER;
> -    else if (cause_code >= 108 && cause_code <= 255)
> +    else if (cause_code >= 108) /* cause_code <= 255 is always true */
>          /* 108 to 223 reserved, treat as CAUSE_CODE_GENERAL_PROBLEM_OTHER
>           * 224 to 255 reserved for TIA/EIA-41 extension, otherwise treat as CAUSE_CODE_GENERAL_PROBLEM_OTHER */
>          delivery_state += CAUSE_CODE_GENERAL_PROBLEM_OTHER;
> --
> 2.15.0.rc2.357.g7e34df9404-goog
>



-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list