Skip to content

Instantly share code, notes, and snippets.

@JerrySievert
Created February 22, 2016 15:49
Show Gist options
  • Save JerrySievert/cf8f0711bd2d72929f1a to your computer and use it in GitHub Desktop.
Save JerrySievert/cf8f0711bd2d72929f1a to your computer and use it in GitHub Desktop.
~/Downloads/checker-278/bin/scan-build make
scan-build: Using '/Users/jerry/Downloads/checker-278/bin/clang' for static analysis
/Users/jerry/Downloads/checker-278/bin/../libexec/ccc-analyzer -Isrc -Wall -Werror -march=native -O3 -c src/http_request.cpp -o src/http_request.o
/Users/jerry/Downloads/checker-278/bin/../libexec/ccc-analyzer -Isrc -Wall -Werror -march=native -O3 -c src/http_response.cpp -o src/http_response.o
/Users/jerry/Downloads/checker-278/bin/../libexec/ccc-analyzer -Isrc -Wall -Werror -march=native -O3 -c src/http_router.cpp -o src/http_router.o
/Users/jerry/Downloads/checker-278/bin/../libexec/ccc-analyzer -Isrc -Wall -Werror -march=native -O3 -c test/http_request.cpp -o test/http_request.o
test/http_request.cpp:18:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_GET), "method is set to GET");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:25:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_POST), "method is set to POST");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:32:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_PUT), "method is set to PUT");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:39:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_ERROR), "method is set to ERROR");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:45:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_ERROR), "method is set to ERROR");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:51:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_ERROR), "method is set to ERROR");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:57:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_ERROR), "method is set to ERROR");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:63:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_GET), "method is set to GET");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:71:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_GET), "method is set to GET");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:82:10: warning: Access to field 'method' results in a dereference of a null pointer (loaded from variable 'request')
check((request->method == HTTP_GET), "method is set to GET");
^~~~~~~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:110:26: warning: Array access (from variable 'params') results in a null pointer dereference
check((strcmp((char *) params[0], "test=hello") == 0), "first param is correct");
^~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:117:26: warning: Array access (from variable 'params') results in a null pointer dereference
check((strcmp((char *) params[0], "test=hello") == 0), "first param is correct");
^~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:125:26: warning: Array access (from variable 'params') results in a null pointer dereference
check((strcmp((char *) params[0], "test=hello") == 0), "first param is correct");
^~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:134:26: warning: Array access (from variable 'params') results in a null pointer dereference
check((strcmp((char *) params[0], "test=hello") == 0), "first param is correct");
^~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:155:26: warning: Array access (from variable 'headers') results in a null pointer dereference
check((strcmp((char *) headers[0], "Header1: foo") == 0), "first header is correct");
^~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
test/http_request.cpp:162:26: warning: Array access (from variable 'headers') results in a null pointer dereference
check((strcmp((char *) headers[0], "Header1: foo") == 0), "first header is correct");
^~~~~~~~~~
test/test.h:29:40: note: expanded from macro 'check'
#define check(cond,message) do { if (!(cond)) { _test_fail(message, __FILE__, __LINE__); test_failed++; } else { _test_pass(message); test_passed++; } delay(25); } while (0)
^~~~
16 warnings generated.
/Users/jerry/Downloads/checker-278/bin/../libexec/ccc-analyzer -Isrc -Wall -Werror -march=native -O3 -c test/http_response.cpp -o test/http_response.o
/Users/jerry/Downloads/checker-278/bin/../libexec/ccc-analyzer -Isrc -Wall -Werror -march=native -O3 -c test/test.cpp -o test/test.o
ar -cvq libtinyhttp.a src/http_request.o src/http_response.o src/http_router.o
q - src/http_request.o
q - src/http_response.o
q - src/http_router.o
/Users/jerry/Downloads/checker-278/bin/../libexec/ccc-analyzer -O3 src/http_request.o src/http_response.o src/http_router.o test/http_request.o test/http_response.o test/test.o -o test_runner
scan-build: 16 bugs found.
scan-build: Run 'scan-view /var/folders/1t/s_l81v0x03qgkgddrg61443r0000gn/T/scan-build-2016-02-22-074843-60871-1' to examine bug reports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment