Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cc -O2 -pipe -std=c99 -Wall -Wextra -Wno-unknown-pragmas -I/usr/local/include -I/usr/local/include/stlink -I/usr/include/libusb-1.0 -L/usr/local/lib -o swd2 swd2.c -lstlink
- swd2.c:332:25: error: parameter 1 (‘start’) has incomplete type
- 332 | elapsed(struct timespec start, struct timespec stop)
- | ~~~~~~~~~~~~~~~~^~~~~
- swd2.c:332:48: error: parameter 2 (‘stop’) has incomplete type
- 332 | elapsed(struct timespec start, struct timespec stop)
- | ~~~~~~~~~~~~~~~~^~~~
- swd2.c:332:1: error: return type is an incomplete type
- 332 | elapsed(struct timespec start, struct timespec stop)
- | ^~~~~~~
- swd2.c: In function ‘elapsed’:
- swd2.c:335:10: error: variable ‘result’ has initializer but incomplete type
- 335 | struct timespec result = {
- | ^~~~~~~~
- swd2.c:336:5: error: ‘struct timespec’ has no member named ‘tv_sec’
- 336 | .tv_sec = stop.tv_sec - start.tv_sec - 1,
- | ^~~~~~
- swd2.c:336:15: warning: excess elements in struct initializer
- 336 | .tv_sec = stop.tv_sec - start.tv_sec - 1,
- | ^~~~
- swd2.c:336:15: note: (near initialization for ‘result’)
- swd2.c:337:5: error: ‘struct timespec’ has no member named ‘tv_nsec’
- 337 | .tv_nsec = stop.tv_nsec - start.tv_nsec + 1000000000
- | ^~~~~~~
- swd2.c:337:15: warning: excess elements in struct initializer
- 337 | .tv_nsec = stop.tv_nsec - start.tv_nsec + 1000000000
- | ^~~~
- swd2.c:337:15: note: (near initialization for ‘result’)
- swd2.c:335:19: error: storage size of ‘result’ isn’t known
- 335 | struct timespec result = {
- | ^~~~~~
- swd2.c:339:10: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
- 339 | return result;
- | ^~~~~~
- swd2.c:332:1: note: declared here
- 332 | elapsed(struct timespec start, struct timespec stop)
- | ^~~~~~~
- swd2.c:335:19: warning: unused variable ‘result’ [-Wunused-variable]
- 335 | struct timespec result = {
- | ^~~~~~
- swd2.c:341:17: error: variable ‘result’ has initializer but incomplete type
- 341 | struct timespec result = {
- | ^~~~~~~~
- swd2.c:342:5: error: ‘struct timespec’ has no member named ‘tv_sec’
- 342 | .tv_sec = stop.tv_sec - start.tv_sec,
- | ^~~~~~
- swd2.c:342:15: warning: excess elements in struct initializer
- 342 | .tv_sec = stop.tv_sec - start.tv_sec,
- | ^~~~
- swd2.c:342:15: note: (near initialization for ‘result’)
- swd2.c:343:12: error: ‘struct timespec’ has no member named ‘tv_nsec’
- 343 | .tv_nsec = stop.tv_nsec - start.tv_nsec
- | ^~~~~~~
- swd2.c:343:22: warning: excess elements in struct initializer
- 343 | .tv_nsec = stop.tv_nsec - start.tv_nsec
- | ^~~~
- swd2.c:343:22: note: (near initialization for ‘result’)
- swd2.c:341:26: error: storage size of ‘result’ isn’t known
- 341 | struct timespec result = {
- | ^~~~~~
- swd2.c:345:10: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
- 345 | return result;
- | ^~~~~~
- swd2.c:332:1: note: declared here
- 332 | elapsed(struct timespec start, struct timespec stop)
- | ^~~~~~~
- swd2.c:341:26: warning: unused variable ‘result’ [-Wunused-variable]
- 341 | struct timespec result = {
- | ^~~~~~
- swd2.c:332:25: warning: unused parameter ‘start’ [-Wunused-parameter]
- 332 | elapsed(struct timespec start, struct timespec stop)
- | ~~~~~~~~~~~~~~~~^~~~~
- swd2.c:332:48: warning: unused parameter ‘stop’ [-Wunused-parameter]
- 332 | elapsed(struct timespec start, struct timespec stop)
- | ~~~~~~~~~~~~~~~~^~~~
- swd2.c: At top level:
- swd2.c:370:1: error: return type is an incomplete type
- 370 | get_time(void)
- | ^~~~~~~~
- swd2.c: In function ‘get_time’:
- swd2.c:372:18: error: storage size of ‘ts’ isn’t known
- 372 | struct timespec ts;
- | ^~
- swd2.c:375:2: warning: implicit declaration of function ‘clock_gettime’ [-Wimplicit-function-declaration]
- 375 | clock_gettime(CLOCK_MONOTONIC_FAST, &ts);
- | ^~~~~~~~~~~~~
- swd2.c:22:30: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function); did you mean ‘CLOCK_MONOTONIC_FAST’?
- 22 | #define CLOCK_MONOTONIC_FAST CLOCK_MONOTONIC
- | ^~~~~~~~~~~~~~~
- swd2.c:375:16: note: in expansion of macro ‘CLOCK_MONOTONIC_FAST’
- 375 | clock_gettime(CLOCK_MONOTONIC_FAST, &ts);
- | ^~~~~~~~~~~~~~~~~~~~
- swd2.c:22:30: note: each undeclared identifier is reported only once for each function it appears in
- 22 | #define CLOCK_MONOTONIC_FAST CLOCK_MONOTONIC
- | ^~~~~~~~~~~~~~~
- swd2.c:375:16: note: in expansion of macro ‘CLOCK_MONOTONIC_FAST’
- 375 | clock_gettime(CLOCK_MONOTONIC_FAST, &ts);
- | ^~~~~~~~~~~~~~~~~~~~
- swd2.c:377:9: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
- 377 | return ts;
- | ^~
- swd2.c:370:1: note: declared here
- 370 | get_time(void)
- | ^~~~~~~~
- swd2.c:372:18: warning: unused variable ‘ts’ [-Wunused-variable]
- 372 | struct timespec ts;
- | ^~
- swd2.c: In function ‘stdin_file_type_or_die’:
- swd2.c:411:40: error: ‘S_IFMT’ undeclared (first use in this function)
- 411 | const mode_t file_type = sb.st_mode & S_IFMT;
- | ^~~~~~
- swd2.c:413:8: error: ‘S_IFIFO’ undeclared (first use in this function); did you mean ‘S_ISFIFO’?
- 413 | case S_IFIFO:
- | ^~~~~~~
- | S_ISFIFO
- swd2.c:417:8: error: ‘S_IFCHR’ undeclared (first use in this function); did you mean ‘S_ISCHR’?
- 417 | case S_IFCHR:
- | ^~~~~~~
- | S_ISCHR
- swd2.c:423:8: error: ‘S_IFREG’ undeclared (first use in this function); did you mean ‘S_ISREG’?
- 423 | case S_IFREG:
- | ^~~~~~~
- | S_ISREG
- swd2.c: In function ‘install_signal_handlers’:
- swd2.c:454:19: error: array type has incomplete element type ‘struct sigaction’
- 454 | struct sigaction action[1] = {{ .sa_handler = handler_int }};
- | ^~~~~~
- swd2.c:454:34: error: field name not in record or union initializer
- 454 | struct sigaction action[1] = {{ .sa_handler = handler_int }};
- | ^
- swd2.c:454:34: note: (near initialization for ‘action’)
- swd2.c:455:2: warning: implicit declaration of function ‘sigemptyset’ [-Wimplicit-function-declaration]
- 455 | sigemptyset(&action->sa_mask);
- | ^~~~~~~~~~~
- swd2.c:456:2: warning: implicit declaration of function ‘sigaction’ [-Wimplicit-function-declaration]
- 456 | sigaction(SIGINT, action, NULL);
- | ^~~~~~~~~
- swd2.c:454:19: warning: unused variable ‘action’ [-Wunused-variable]
- 454 | struct sigaction action[1] = {{ .sa_handler = handler_int }};
- | ^~~~~~
- swd2.c: In function ‘main’:
- swd2.c:501:9: error: variable ‘last_active’ has initializer but incomplete type
- 501 | struct timespec last_active = get_time();
- | ^~~~~~~~
- swd2.c:501:18: error: storage size of ‘last_active’ isn’t known
- 501 | struct timespec last_active = get_time();
- | ^~~~~~~~~~~
- swd2.c:507:10: error: variable ‘now’ has initializer but incomplete type
- 507 | struct timespec now = get_time();
- | ^~~~~~~~
- swd2.c:507:19: error: storage size of ‘now’ isn’t known
- 507 | struct timespec now = get_time();
- | ^~~
- swd2.c:524:11: error: variable ‘diff’ has initializer but incomplete type
- 524 | struct timespec diff = elapsed(last_active, now);
- | ^~~~~~~~
- swd2.c:524:20: error: storage size of ‘diff’ isn’t known
- 524 | struct timespec diff = elapsed(last_active, now);
- | ^~~~
- swd2.c:526:5: warning: implicit declaration of function ‘usleep’; did you mean ‘sleep’? [-Wimplicit-function-declaration]
- 526 | usleep(10*1000);
- | ^~~~~~
- | sleep
- swd2.c:524:20: warning: unused variable ‘diff’ [-Wunused-variable]
- 524 | struct timespec diff = elapsed(last_active, now);
- | ^~~~
- swd2.c:507:19: warning: unused variable ‘now’ [-Wunused-variable]
- 507 | struct timespec now = get_time();
- | ^~~
- swd2.c:501:18: warning: unused variable ‘last_active’ [-Wunused-variable]
- 501 | struct timespec last_active = get_time();
- | ^~~~~~~~~~~
- make: *** [Makefile:15: swd2] Error 1
- [3]+ Done emacs Makefile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement