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

getopt_long returns 255 #102

Open
huangshiyou opened this issue Nov 24, 2020 · 0 comments
Open

getopt_long returns 255 #102

huangshiyou opened this issue Nov 24, 2020 · 0 comments

Comments

@huangshiyou
Copy link

When I tried to run wrk2 on an arm machine, it gives me incorrect results when parsing command-line arguments. It turns out that

wrk2/src/wrk.c

Line 721 in 44a94c1

while ((c = getopt_long(argc, argv, "t:c:d:s:H:T:R:LUBrv?", longopts, NULL)) != -1) {

assigns the return value of which the type is int to c of which the type is char. -1 is converted to 255.

Change char to signed char solves the problem.

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

1 participant