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: warning: adding 'const char' to a string does not append to the … #26

Merged
merged 1 commit into from
Feb 8, 2020

Conversation

shogo82148
Copy link
Owner

…string [-Wstring-plus-int]

https://github.com/shogo82148/mecab/runs/431774760?check_suite_focus=true#step:4:295

writer.cpp:255:61: warning: adding 'const char' to a string does not append to the string [-Wstring-plus-int]
            const std::string error = "unknown meta char: " + *p;
                                      ~~~~~~~~~~~~~~~~~~~~~~^~~~
writer.cpp:255:61: note: use array indexing to silence this warning
            const std::string error = "unknown meta char: " + *p;
                                                            ^
                                      &                     [   ]

@shogo82148
Copy link
Owner Author

before:

$ mecab --node-format=%z
ほげ
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
Abort trap: 6

after:

$ ./src/mecab --node-format=%z
ほげ
unknown meta char: z

@shogo82148 shogo82148 merged commit ca15dc7 into master Feb 8, 2020
@shogo82148 shogo82148 deleted the fix-warn-string-plus-int branch February 8, 2020 00:50
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

Successfully merging this pull request may close these issues.

1 participant