Dominique Pelle wrote:

> Attached patch fixes the following warnings given
> by the clang compiler:
> 
> clang  -g -O3 -Wall -Wextra -Wmissing-prototypes -Wunreachable-code
> -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1   -DUNIX -o xxd xxd.c
> xxd.c:725:30: warning: adding 'int' to a string does not append to the
> string [-Wstring-plus-int]
>                 (p % cols) ? ", " : ",\n  "+2*!p,  c) < 0)
>                                     ~~~~~~~^~~~~
> xxd.c:725:30: note: use array indexing to silence this warning
>                 (p % cols) ? ", " : ",\n  "+2*!p,  c) < 0)
>                                            ^
>                                     &      [    ]
> xxd.c:734:24: warning: adding 'int' to a string does not append to the
> string [-Wstring-plus-int]
>       if (fputs("};\n" + 3 * (fp == stdin), fpo) == EOF)
>                 ~~~~~~~^~~~~~~~~~~~~~~~~~~
> xxd.c:734:24: note: use array indexing to silence this warning
>       if (fputs("};\n" + 3 * (fp == stdin), fpo) == EOF)
>                        ^
>                 &      [                  ]

Thanks, I'll include this patch.

> clang also gives this warning:
> 
> ./regexp_nfa.c:2814:13: warning: will never be executed [-Wunreachable-code]
>     return -1;
>             ^
> 
> I did not fix it because removing the return statement
> may give a warning on other compilers.

Indeed.  I can change the "for" into a "while".  Checking for "state"
not to be NULL is somewhat meaningfull.  It should never happen, but
it's good not to crash when it does happen.

> clang also warns about this:
> 
> ex_eval.c:1716:50: warning: will never be executed [-Wunreachable-code]
>                     pending |= (THROW_ON_ERROR) ? CSTP_THROW : 0;
>                                                                ^
> I did not fix it either. It's nitpicky.

Would have to be some ugly #ifdef.  Is it possible to suppress the warning?

-- 
XML is a nice language for computers.  Not for humans.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui