Advertisement
Guest User

Untitled

a guest
Jun 14th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.88 KB | None | 0 0
  1. 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
  2. swd2.c:332:25: error: parameter 1 (‘start’) has incomplete type
  3. 332 | elapsed(struct timespec start, struct timespec stop)
  4. | ~~~~~~~~~~~~~~~~^~~~~
  5. swd2.c:332:48: error: parameter 2 (‘stop’) has incomplete type
  6. 332 | elapsed(struct timespec start, struct timespec stop)
  7. | ~~~~~~~~~~~~~~~~^~~~
  8. swd2.c:332:1: error: return type is an incomplete type
  9. 332 | elapsed(struct timespec start, struct timespec stop)
  10. | ^~~~~~~
  11. swd2.c: In function ‘elapsed’:
  12. swd2.c:335:10: error: variable ‘result’ has initializer but incomplete type
  13. 335 | struct timespec result = {
  14. | ^~~~~~~~
  15. swd2.c:336:5: error: ‘struct timespec’ has no member named ‘tv_sec’
  16. 336 | .tv_sec = stop.tv_sec - start.tv_sec - 1,
  17. | ^~~~~~
  18. swd2.c:336:15: warning: excess elements in struct initializer
  19. 336 | .tv_sec = stop.tv_sec - start.tv_sec - 1,
  20. | ^~~~
  21. swd2.c:336:15: note: (near initialization for ‘result’)
  22. swd2.c:337:5: error: ‘struct timespec’ has no member named ‘tv_nsec’
  23. 337 | .tv_nsec = stop.tv_nsec - start.tv_nsec + 1000000000
  24. | ^~~~~~~
  25. swd2.c:337:15: warning: excess elements in struct initializer
  26. 337 | .tv_nsec = stop.tv_nsec - start.tv_nsec + 1000000000
  27. | ^~~~
  28. swd2.c:337:15: note: (near initialization for ‘result’)
  29. swd2.c:335:19: error: storage size of ‘result’ isn’t known
  30. 335 | struct timespec result = {
  31. | ^~~~~~
  32. swd2.c:339:10: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
  33. 339 | return result;
  34. | ^~~~~~
  35. swd2.c:332:1: note: declared here
  36. 332 | elapsed(struct timespec start, struct timespec stop)
  37. | ^~~~~~~
  38. swd2.c:335:19: warning: unused variable ‘result’ [-Wunused-variable]
  39. 335 | struct timespec result = {
  40. | ^~~~~~
  41. swd2.c:341:17: error: variable ‘result’ has initializer but incomplete type
  42. 341 | struct timespec result = {
  43. | ^~~~~~~~
  44. swd2.c:342:5: error: ‘struct timespec’ has no member named ‘tv_sec’
  45. 342 | .tv_sec = stop.tv_sec - start.tv_sec,
  46. | ^~~~~~
  47. swd2.c:342:15: warning: excess elements in struct initializer
  48. 342 | .tv_sec = stop.tv_sec - start.tv_sec,
  49. | ^~~~
  50. swd2.c:342:15: note: (near initialization for ‘result’)
  51. swd2.c:343:12: error: ‘struct timespec’ has no member named ‘tv_nsec’
  52. 343 | .tv_nsec = stop.tv_nsec - start.tv_nsec
  53. | ^~~~~~~
  54. swd2.c:343:22: warning: excess elements in struct initializer
  55. 343 | .tv_nsec = stop.tv_nsec - start.tv_nsec
  56. | ^~~~
  57. swd2.c:343:22: note: (near initialization for ‘result’)
  58. swd2.c:341:26: error: storage size of ‘result’ isn’t known
  59. 341 | struct timespec result = {
  60. | ^~~~~~
  61. swd2.c:345:10: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
  62. 345 | return result;
  63. | ^~~~~~
  64. swd2.c:332:1: note: declared here
  65. 332 | elapsed(struct timespec start, struct timespec stop)
  66. | ^~~~~~~
  67. swd2.c:341:26: warning: unused variable ‘result’ [-Wunused-variable]
  68. 341 | struct timespec result = {
  69. | ^~~~~~
  70. swd2.c:332:25: warning: unused parameter ‘start’ [-Wunused-parameter]
  71. 332 | elapsed(struct timespec start, struct timespec stop)
  72. | ~~~~~~~~~~~~~~~~^~~~~
  73. swd2.c:332:48: warning: unused parameter ‘stop’ [-Wunused-parameter]
  74. 332 | elapsed(struct timespec start, struct timespec stop)
  75. | ~~~~~~~~~~~~~~~~^~~~
  76. swd2.c: At top level:
  77. swd2.c:370:1: error: return type is an incomplete type
  78. 370 | get_time(void)
  79. | ^~~~~~~~
  80. swd2.c: In function ‘get_time’:
  81. swd2.c:372:18: error: storage size of ‘ts’ isn’t known
  82. 372 | struct timespec ts;
  83. | ^~
  84. swd2.c:375:2: warning: implicit declaration of function ‘clock_gettime’ [-Wimplicit-function-declaration]
  85. 375 | clock_gettime(CLOCK_MONOTONIC_FAST, &ts);
  86. | ^~~~~~~~~~~~~
  87. swd2.c:22:30: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function); did you mean ‘CLOCK_MONOTONIC_FAST’?
  88. 22 | #define CLOCK_MONOTONIC_FAST CLOCK_MONOTONIC
  89. | ^~~~~~~~~~~~~~~
  90. swd2.c:375:16: note: in expansion of macro ‘CLOCK_MONOTONIC_FAST’
  91. 375 | clock_gettime(CLOCK_MONOTONIC_FAST, &ts);
  92. | ^~~~~~~~~~~~~~~~~~~~
  93. swd2.c:22:30: note: each undeclared identifier is reported only once for each function it appears in
  94. 22 | #define CLOCK_MONOTONIC_FAST CLOCK_MONOTONIC
  95. | ^~~~~~~~~~~~~~~
  96. swd2.c:375:16: note: in expansion of macro ‘CLOCK_MONOTONIC_FAST’
  97. 375 | clock_gettime(CLOCK_MONOTONIC_FAST, &ts);
  98. | ^~~~~~~~~~~~~~~~~~~~
  99. swd2.c:377:9: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
  100. 377 | return ts;
  101. | ^~
  102. swd2.c:370:1: note: declared here
  103. 370 | get_time(void)
  104. | ^~~~~~~~
  105. swd2.c:372:18: warning: unused variable ‘ts’ [-Wunused-variable]
  106. 372 | struct timespec ts;
  107. | ^~
  108. swd2.c: In function ‘stdin_file_type_or_die’:
  109. swd2.c:411:40: error: ‘S_IFMT’ undeclared (first use in this function)
  110. 411 | const mode_t file_type = sb.st_mode & S_IFMT;
  111. | ^~~~~~
  112. swd2.c:413:8: error: ‘S_IFIFO’ undeclared (first use in this function); did you mean ‘S_ISFIFO’?
  113. 413 | case S_IFIFO:
  114. | ^~~~~~~
  115. | S_ISFIFO
  116. swd2.c:417:8: error: ‘S_IFCHR’ undeclared (first use in this function); did you mean ‘S_ISCHR’?
  117. 417 | case S_IFCHR:
  118. | ^~~~~~~
  119. | S_ISCHR
  120. swd2.c:423:8: error: ‘S_IFREG’ undeclared (first use in this function); did you mean ‘S_ISREG’?
  121. 423 | case S_IFREG:
  122. | ^~~~~~~
  123. | S_ISREG
  124. swd2.c: In function ‘install_signal_handlers’:
  125. swd2.c:454:19: error: array type has incomplete element type ‘struct sigaction’
  126. 454 | struct sigaction action[1] = {{ .sa_handler = handler_int }};
  127. | ^~~~~~
  128. swd2.c:454:34: error: field name not in record or union initializer
  129. 454 | struct sigaction action[1] = {{ .sa_handler = handler_int }};
  130. | ^
  131. swd2.c:454:34: note: (near initialization for ‘action’)
  132. swd2.c:455:2: warning: implicit declaration of function ‘sigemptyset’ [-Wimplicit-function-declaration]
  133. 455 | sigemptyset(&action->sa_mask);
  134. | ^~~~~~~~~~~
  135. swd2.c:456:2: warning: implicit declaration of function ‘sigaction’ [-Wimplicit-function-declaration]
  136. 456 | sigaction(SIGINT, action, NULL);
  137. | ^~~~~~~~~
  138. swd2.c:454:19: warning: unused variable ‘action’ [-Wunused-variable]
  139. 454 | struct sigaction action[1] = {{ .sa_handler = handler_int }};
  140. | ^~~~~~
  141. swd2.c: In function ‘main’:
  142. swd2.c:501:9: error: variable ‘last_active’ has initializer but incomplete type
  143. 501 | struct timespec last_active = get_time();
  144. | ^~~~~~~~
  145. swd2.c:501:18: error: storage size of ‘last_active’ isn’t known
  146. 501 | struct timespec last_active = get_time();
  147. | ^~~~~~~~~~~
  148. swd2.c:507:10: error: variable ‘now’ has initializer but incomplete type
  149. 507 | struct timespec now = get_time();
  150. | ^~~~~~~~
  151. swd2.c:507:19: error: storage size of ‘now’ isn’t known
  152. 507 | struct timespec now = get_time();
  153. | ^~~
  154. swd2.c:524:11: error: variable ‘diff’ has initializer but incomplete type
  155. 524 | struct timespec diff = elapsed(last_active, now);
  156. | ^~~~~~~~
  157. swd2.c:524:20: error: storage size of ‘diff’ isn’t known
  158. 524 | struct timespec diff = elapsed(last_active, now);
  159. | ^~~~
  160. swd2.c:526:5: warning: implicit declaration of function ‘usleep’; did you mean ‘sleep’? [-Wimplicit-function-declaration]
  161. 526 | usleep(10*1000);
  162. | ^~~~~~
  163. | sleep
  164. swd2.c:524:20: warning: unused variable ‘diff’ [-Wunused-variable]
  165. 524 | struct timespec diff = elapsed(last_active, now);
  166. | ^~~~
  167. swd2.c:507:19: warning: unused variable ‘now’ [-Wunused-variable]
  168. 507 | struct timespec now = get_time();
  169. | ^~~
  170. swd2.c:501:18: warning: unused variable ‘last_active’ [-Wunused-variable]
  171. 501 | struct timespec last_active = get_time();
  172. | ^~~~~~~~~~~
  173. make: *** [Makefile:15: swd2] Error 1
  174. [3]+ Done emacs Makefile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement