Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix array-subscript-is-char warning for Clang on Windows #46

Open
andrewhayden opened this issue Oct 28, 2015 · 0 comments
Open

Fix array-subscript-is-char warning for Clang on Windows #46

andrewhayden opened this issue Oct 28, 2015 · 0 comments

Comments

@andrewhayden
Copy link
Member

As seen here:
https://codereview.chromium.org/1426873002/

It looks like CLD2 generates some warnings on Windows under some Clang configurations on Windows:
FAILED: ninja -t msvc -e environment.x64 --
../../third_party/llvm-build/Release+Asserts/bin/clang-cl.exe /nologo
/showIncludes /FC @obj/third_party/cld_2/cld2_static/offsetmap.obj.rsp
/c
../../third_party/cld_2/src/internal/offsetmap.cc
/Foobj/third_party/cld_2/cld2_static/offsetmap.obj
/Fdobj/third_party/cld_2/cld2_static_cc.pdb
../../third_party/cld_2/src/internal/offsetmap.cc(84,36) : error: array subscript is of type 'char'
[-Werror,-Wchar-subscripts]
fprintf(fout, "%c%02d", "&=+-"[OpPart(diffs_[i])], LenPart(diffs_[i]));
^~~~~~~~~~~~~~~~~~
../../third_party/cld_2/src/internal/offsetmap.cc(210,38) :
error: array subscript is of type 'char' [-Werror,-Wchar-subscripts]
fprintf(stderr, "%c%02d ", "&=+-"[OpPart(diffs_[i])], LenPart(diffs_[i]));
^~~~~~~~~~~~~~~~~~
2 errors generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@andrewhayden and others