warning: comparison of unsigned expression >= 0 is always true

前端 未结 5 1249
野性不改
野性不改 2020-12-11 23:23

I have the following error when compiling a C file:

t_memmove.c: In function ‘ft_memmove’:
ft_memmove.c:19: warning: comparison of unsigned expression >=          


        
5条回答
  •  甜味超标
    2020-12-12 00:07

    Arithmetic on unsigned results in an unsigned and that's why you are getting this warning. Better to change n - i >= 0 to n >= i.

提交回复
热议问题