Hi

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)
                       ^
                &      [                  ]


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.


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.

Regards
Dominique

-- 
-- 
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.


Attachment: fix-clang-warning-xxd.c-7.3.1223.patch
Description: Binary data

Raspunde prin e-mail lui