fork(2) download
  1.  
  2. リストに要素を挿入していって、それを後に挿入した要素から順に出力する
  3. 関数を作る(宣言している関数の形は変えないでください)問題なんですが
  4. 自分のかいたようなコードだとd→c→b→aのように出力したいんですがわかりません。
  5. お願いします。以下コード
  6. #include<stdio.h>
  7. #include<string.h>
  8. #include<stdlib.h>
  9. struct data{
  10. char key;
  11. struct data *next;
  12. };
  13.  
  14. void print_stack_list(struct data *top);
  15.  
  16.  
  17. int main()
  18. {
  19.  
  20. struct data *top, *cur;
  21.  
  22.  
  23.  
  24. top = (struct data*)malloc(sizeof(struct data));
  25. if(top == NULL){printf("メモりが確保できませんでした。\n"); return 1; }
  26. cur = top;
  27.  
  28. top->key = 'a';
  29. top->next = (struct data*)malloc(sizeof(struct data));
  30. if(top->next == NULL){printf("メモりが確保できませんでした。\n"); return 1; }
  31. top = top->next;
  32.  
  33. top->key = 'b';
  34. top->next = (struct data*)malloc(sizeof(struct data));
  35. if(top->next == NULL){printf("メモりが確保できませんでした。\n");
  36. return 1; }
  37. top = top->next;
  38.  
  39. top->key = 'c';
  40. top->next = (struct data*)malloc(sizeof(struct data));
  41. if(top->next == NULL){printf("メモりが確保できませんでした。\n");
  42. return 1; }
  43. top = top->next;
  44.  
  45. top->key = 'd';
  46. top->next = NULL;
  47.  
  48.  
  49.  
  50. print_stack_list(top);
  51.  
  52.  
  53.  
  54.  
  55. return 0;
  56.  
  57. }
  58.  
  59. void print_stack_list(struct data *top)
  60. {
  61.  
  62. while(top = )
  63. {
  64.  
  65. printf("%c\n",top->key);
  66.  
  67. top = top->next;
  68. }
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75. }
  76.  
  77.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\203’ in program
prog.c:2: error: stray ‘\252’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\202’ in program
prog.c:2: error: stray ‘\271’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\203’ in program
prog.c:2: error: stray ‘\210’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\253’ in program
prog.c:2: error: stray ‘\350’ in program
prog.c:2: error: stray ‘\246’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\347’ in program
prog.c:2: error: stray ‘\264’ in program
prog.c:2: error: stray ‘\240’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\202’ in program
prog.c:2: error: stray ‘\222’ in program
prog.c:2: error: stray ‘\346’ in program
prog.c:2: error: stray ‘\214’ in program
prog.c:2: error: stray ‘\277’ in program
prog.c:2: error: stray ‘\345’ in program
prog.c:2: error: stray ‘\205’ in program
prog.c:2: error: stray ‘\245’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\227’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\246’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\204’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\243’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\246’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\200’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\235’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\202’ in program
prog.c:2: error: stray ‘\214’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\202’ in program
prog.c:2: error: stray ‘\222’ in program
prog.c:2: error: stray ‘\345’ in program
prog.c:2: error: stray ‘\276’ in program
prog.c:2: error: stray ‘\214’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\253’ in program
prog.c:2: error: stray ‘\346’ in program
prog.c:2: error: stray ‘\214’ in program
prog.c:2: error: stray ‘\277’ in program
prog.c:2: error: stray ‘\345’ in program
prog.c:2: error: stray ‘\205’ in program
prog.c:2: error: stray ‘\245’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\227’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\237’ in program
prog.c:2: error: stray ‘\350’ in program
prog.c:2: error: stray ‘\246’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\347’ in program
prog.c:2: error: stray ‘\264’ in program
prog.c:2: error: stray ‘\240’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\213’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\202’ in program
prog.c:2: error: stray ‘\211’ in program
prog.c:2: error: stray ‘\351’ in program
prog.c:2: error: stray ‘\240’ in program
prog.c:2: error: stray ‘\206’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\253’ in program
prog.c:2: error: stray ‘\345’ in program
prog.c:2: error: stray ‘\207’ in program
prog.c:2: error: stray ‘\272’ in program
prog.c:2: error: stray ‘\345’ in program
prog.c:2: error: stray ‘\212’ in program
prog.c:2: error: stray ‘\233’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\201’ in program
prog.c:2: error: stray ‘\231’ in program
prog.c:2: error: stray ‘\343’ in program
prog.c:2: error: stray ‘\202’ in program
prog.c:2: error: stray ‘\213’ in program
prog.c:3: error: stray ‘\351’ in program
prog.c:3: error: stray ‘\226’ in program
prog.c:3: error: stray ‘\242’ in program
prog.c:3: error: stray ‘\346’ in program
prog.c:3: error: stray ‘\225’ in program
prog.c:3: error: stray ‘\260’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\202’ in program
prog.c:3: error: stray ‘\222’ in program
prog.c:3: error: stray ‘\344’ in program
prog.c:3: error: stray ‘\275’ in program
prog.c:3: error: stray ‘\234’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\202’ in program
prog.c:3: error: stray ‘\213’ in program
prog.c:3: error: stray ‘\357’ in program
prog.c:3: error: stray ‘\274’ in program
prog.c:3: error: stray ‘\210’ in program
prog.c:3: error: stray ‘\345’ in program
prog.c:3: error: stray ‘\256’ in program
prog.c:3: error: stray ‘\243’ in program
prog.c:3: error: stray ‘\350’ in program
prog.c:3: error: stray ‘\250’ in program
prog.c:3: error: stray ‘\200’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\227’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\246’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\204’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\202’ in program
prog.c:3: error: stray ‘\213’ in program
prog.c:3: error: stray ‘\351’ in program
prog.c:3: error: stray ‘\226’ in program
prog.c:3: error: stray ‘\242’ in program
prog.c:3: error: stray ‘\346’ in program
prog.c:3: error: stray ‘\225’ in program
prog.c:3: error: stray ‘\260’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\256’ in program
prog.c:3: error: stray ‘\345’ in program
prog.c:3: error: stray ‘\275’ in program
prog.c:3: error: stray ‘\242’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\257’ in program
prog.c:3: error: stray ‘\345’ in program
prog.c:3: error: stray ‘\244’ in program
prog.c:3: error: stray ‘\211’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\210’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\252’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\204’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\247’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\217’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\240’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\225’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\204’ in program
prog.c:3: error: stray ‘\357’ in program
prog.c:3: error: stray ‘\274’ in program
prog.c:3: error: stray ‘\211’ in program
prog.c:3: error: stray ‘\345’ in program
prog.c:3: error: stray ‘\225’ in program
prog.c:3: error: stray ‘\217’ in program
prog.c:3: error: stray ‘\351’ in program
prog.c:3: error: stray ‘\241’ in program
prog.c:3: error: stray ‘\214’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\252’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\202’ in program
prog.c:3: error: stray ‘\223’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\247’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\231’ in program
prog.c:3: error: stray ‘\343’ in program
prog.c:3: error: stray ‘\201’ in program
prog.c:3: error: stray ‘\214’ in program
prog.c:4: error: stray ‘\350’ in program
prog.c:4: error: stray ‘\207’ in program
prog.c:4: error: stray ‘\252’ in program
prog.c:4: error: stray ‘\345’ in program
prog.c:4: error: stray ‘\210’ in program
prog.c:4: error: stray ‘\206’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\256’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\213’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\204’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\237’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\202’ in program
prog.c:4: error: stray ‘\210’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\206’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\252’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\202’ in program
prog.c:4: error: stray ‘\263’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\203’ in program
prog.c:4: error: stray ‘\274’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\203’ in program
prog.c:4: error: stray ‘\211’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\240’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\250’ in program
prog.c:4: error: stray ‘\342’ in program
prog.c:4: error: stray ‘\206’ in program
prog.c:4: error: stray ‘\222’ in program
prog.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’
prog.c:4: error: stray ‘\342’ in program
prog.c:4: error: stray ‘\206’ in program
prog.c:4: error: stray ‘\222’ in program
prog.c:4: error: stray ‘\342’ in program
prog.c:4: error: stray ‘\206’ in program
prog.c:4: error: stray ‘\222’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\256’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\202’ in program
prog.c:4: error: stray ‘\210’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\206’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\253’ in program
prog.c:4: error: stray ‘\345’ in program
prog.c:4: error: stray ‘\207’ in program
prog.c:4: error: stray ‘\272’ in program
prog.c:4: error: stray ‘\345’ in program
prog.c:4: error: stray ‘\212’ in program
prog.c:4: error: stray ‘\233’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\227’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\237’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\204’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\202’ in program
prog.c:4: error: stray ‘\223’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\247’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\231’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\214’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\202’ in program
prog.c:4: error: stray ‘\217’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\213’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\202’ in program
prog.c:4: error: stray ‘\212’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\276’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\201’ in program
prog.c:4: error: stray ‘\233’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\202’ in program
prog.c:4: error: stray ‘\223’ in program
prog.c:4: error: stray ‘\343’ in program
prog.c:4: error: stray ‘\200’ in program
prog.c:4: error: stray ‘\202’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\201’ in program
prog.c:5: error: stray ‘\212’ in program
prog.c:5: error: stray ‘\351’ in program
prog.c:5: error: stray ‘\241’ in program
prog.c:5: error: stray ‘\230’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\201’ in program
prog.c:5: error: stray ‘\204’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\201’ in program
prog.c:5: error: stray ‘\227’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\201’ in program
prog.c:5: error: stray ‘\276’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\201’ in program
prog.c:5: error: stray ‘\231’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\200’ in program
prog.c:5: error: stray ‘\202’ in program
prog.c:5: error: stray ‘\344’ in program
prog.c:5: error: stray ‘\273’ in program
prog.c:5: error: stray ‘\245’ in program
prog.c:5: error: stray ‘\344’ in program
prog.c:5: error: stray ‘\270’ in program
prog.c:5: error: stray ‘\213’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\202’ in program
prog.c:5: error: stray ‘\263’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\203’ in program
prog.c:5: error: stray ‘\274’ in program
prog.c:5: error: stray ‘\343’ in program
prog.c:5: error: stray ‘\203’ in program
prog.c:5: error: stray ‘\211’ in program
In file included from /usr/include/stdio.h:75,
                 from prog.c:6:
/usr/include/libio.h:332: error: expected specifier-qualifier-list before ‘size_t’
/usr/include/libio.h:364: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/libio.h:373: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/libio.h:493: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’
In file included from prog.c:6:
/usr/include/stdio.h:312: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:319: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:361: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:363: error: format string argument not a string type
/usr/include/stdio.h:365: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:678: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’
/usr/include/stdio.h:684: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite’
/usr/include/stdio.h:706: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread_unlocked’
/usr/include/stdio.h:708: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite_unlocked’
In file included from /usr/include/stdio.h:906,
                 from prog.c:6:
/usr/include/bits/stdio2.h:24: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h:26: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h:53: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h:54: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h:56: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h:57: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h:62: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h: In function ‘snprintf’:
/usr/include/bits/stdio2.h:65: error: ‘__n’ undeclared (first use in this function)
/usr/include/bits/stdio2.h:65: error: (Each undeclared identifier is reported only once
/usr/include/bits/stdio2.h:65: error: for each function it appears in.)
/usr/include/bits/stdio2.h: At top level:
/usr/include/bits/stdio2.h:75: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h: In function ‘vsnprintf’:
/usr/include/bits/stdio2.h:78: error: ‘__n’ undeclared (first use in this function)
/usr/include/bits/stdio2.h: At top level:
/usr/include/bits/stdio2.h:220: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h: In function ‘gets’:
/usr/include/bits/stdio2.h:228: error: ‘size_t’ undeclared (first use in this function)
/usr/include/bits/stdio2.h:229: error: too many arguments to function ‘__gets_chk’
/usr/include/bits/stdio2.h: At top level:
/usr/include/bits/stdio2.h:233: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h:238: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdio2.h: In function ‘fgets’:
/usr/include/bits/stdio2.h:247: error: ‘size_t’ undeclared (first use in this function)
/usr/include/bits/stdio2.h:250: error: too many arguments to function ‘__fgets_chk’
/usr/include/bits/stdio2.h:252: error: expected ‘)’ before ‘__n’
/usr/include/bits/stdio2.h:253: error: too many arguments to function ‘__fgets_chk_warn’
/usr/include/bits/stdio2.h: At top level:
/usr/include/bits/stdio2.h:258: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__fread_chk’
/usr/include/bits/stdio2.h:261: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__fread_alias’
/usr/include/bits/stdio2.h:265: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__fread_chk_warn’
/usr/include/bits/stdio2.h:274: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’
/usr/include/bits/stdio2.h:319: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__fread_unlocked_chk’
/usr/include/bits/stdio2.h:322: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__fread_unlocked_alias’
/usr/include/bits/stdio2.h:326: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__fread_unlocked_chk_warn’
/usr/include/bits/stdio2.h:335: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread_unlocked’
In file included from prog.c:7:
/usr/include/string.h:39: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:43: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:52: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:59: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:62: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:66: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:88: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:96: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:102: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:109: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strxfrm’
/usr/include/string.h:184: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strcspn’
/usr/include/string.h:188: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strspn’
/usr/include/string.h:242: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strlen’
/usr/include/string.h:270: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:294: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:298: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:302: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:305: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:335: error: expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /usr/include/string.h:423,
                 from prog.c:7:
/usr/include/bits/string2.h:969: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c1’
/usr/include/bits/string2.h:971: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c1’
/usr/include/bits/string2.h:979: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c2’
/usr/include/bits/string2.h:982: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c2’
/usr/include/bits/string2.h:991: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c3’
/usr/include/bits/string2.h:994: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strcspn_c3’
/usr/include/bits/string2.h:1045: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strspn_c1’
/usr/include/bits/string2.h:1047: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strspn_c1’
/usr/include/bits/string2.h:1056: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strspn_c2’
/usr/include/bits/string2.h:1059: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strspn_c2’
/usr/include/bits/string2.h:1068: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strspn_c3’
/usr/include/bits/string2.h:1071: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__strspn_c3’
/usr/include/bits/string2.h: In function ‘__strpbrk_c2’:
/usr/include/bits/string2.h:1129: error: ‘size_t’ undeclared (first use in this function)
/usr/include/bits/string2.h:1129: error: expected ‘;’ before ‘__s’
/usr/include/bits/string2.h: In function ‘__strpbrk_c3’:
/usr/include/bits/string2.h:1142: error: ‘size_t’ undeclared (first use in this function)
/usr/include/bits/string2.h:1142: error: expected ‘;’ before ‘__s’
In file included from /usr/include/bits/string2.h:1298,
                 from /usr/include/string.h:423,
                 from prog.c:7:
/usr/include/stdlib.h: At top level:
/usr/include/stdlib.h:471: error: expected ‘)’ before ‘__size’
/usr/include/stdlib.h:473: error: expected ‘)’ before ‘__nmemb’
In file included from /usr/include/string.h:423,
                 from prog.c:7:
/usr/include/bits/string2.h:1322: error: expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /usr/include/string.h:428,
                 from prog.c:7:
/usr/include/bits/string3.h:49: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h: In function ‘memcpy’:
/usr/include/bits/string3.h:52: error: ‘__len’ undeclared (first use in this function)
/usr/include/bits/string3.h: At top level:
/usr/include/bits/string3.h:56: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h: In function ‘memmove’:
/usr/include/bits/string3.h:59: error: ‘__len’ undeclared (first use in this function)
/usr/include/bits/string3.h: At top level:
/usr/include/bits/string3.h:78: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h: In function ‘memset’:
/usr/include/bits/string3.h:80: error: ‘__len’ undeclared (first use in this function)
/usr/include/bits/string3.h: At top level:
/usr/include/bits/string3.h:90: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h: In function ‘bcopy’:
/usr/include/bits/string3.h:93: error: ‘__len’ undeclared (first use in this function)
/usr/include/bits/string3.h: At top level:
/usr/include/bits/string3.h:97: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h: In function ‘bzero’:
/usr/include/bits/string3.h:99: error: ‘__len’ undeclared (first use in this function)
/usr/include/bits/string3.h: At top level:
/usr/include/bits/string3.h:119: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h: In function ‘strncpy’:
/usr/include/bits/string3.h:122: error: ‘__len’ undeclared (first use in this function)
/usr/include/bits/string3.h: At top level:
/usr/include/bits/string3.h:126: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h:127: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h:128: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h:133: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h: In function ‘stpncpy’:
/usr/include/bits/string3.h:135: error: ‘size_t’ undeclared (first use in this function)
/usr/include/bits/string3.h:136: error: ‘__n’ undeclared (first use in this function)
/usr/include/bits/string3.h:137: error: too many arguments to function ‘__stpncpy_chk’
/usr/include/bits/string3.h:138: error: too many arguments to function ‘__stpncpy_alias’
/usr/include/bits/string3.h: At top level:
/usr/include/bits/string3.h:150: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/string3.h: In function ‘strncat’:
/usr/include/bits/string3.h:153: error: ‘__len’ undeclared (first use in this function)
In file included from prog.c:8:
/usr/include/stdlib.h: At top level:
/usr/include/stdlib.h:140: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__ctype_get_mb_cur_max’
In file included from prog.c:8:
/usr/include/stdlib.h:337: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:367: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:369: error: nonnull argument with out-of-range operand number (argument 1, operand 4)
/usr/include/stdlib.h:485: error: expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /usr/include/stdlib.h:497,
                 from prog.c:8:
/usr/include/alloca.h:33: error: expected ‘)’ before ‘__size’
In file included from prog.c:8:
/usr/include/stdlib.h:502: error: expected ‘)’ before ‘__size’
/usr/include/stdlib.h:507: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:507: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:684: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:684: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:685: error: nonnull argument with out-of-range operand number (argument 1, operand 5)
/usr/include/stdlib.h:689: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:689: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:690: error: nonnull argument with out-of-range operand number (argument 1, operand 4)
/usr/include/stdlib.h:767: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:770: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:774: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:778: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:787: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:791: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:798: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘mbstowcs’
/usr/include/stdlib.h:801: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘wcstombs’
In file included from /usr/include/stdlib.h:882,
                 from prog.c:8:
/usr/include/bits/stdlib.h:26: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h:30: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h: In function ‘realpath’:
/usr/include/bits/stdlib.h:40: error: ‘size_t’ undeclared (first use in this function)
/usr/include/bits/stdlib.h:46: error: too many arguments to function ‘__realpath_chk’
/usr/include/bits/stdlib.h: At top level:
/usr/include/bits/stdlib.h:53: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h:54: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h:55: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h:58: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h:58: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h:65: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h: In function ‘ptsname_r’:
/usr/include/bits/stdlib.h:67: error: ‘size_t’ undeclared (first use in this function)
/usr/include/bits/stdlib.h:69: error: ‘__buflen’ undeclared (first use in this function)
/usr/include/bits/stdlib.h:70: error: too many arguments to function ‘__ptsname_r_chk’
/usr/include/bits/stdlib.h:72: error: too many arguments to function ‘__ptsname_r_chk_warn’
/usr/include/bits/stdlib.h:74: error: too many arguments to function ‘__ptsname_r_alias’
/usr/include/bits/stdlib.h: At top level:
/usr/include/bits/stdlib.h:78: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/bits/stdlib.h: In function ‘wctomb’:
/usr/include/bits/stdlib.h:93: error: ‘size_t’ undeclared (first use in this function)
/usr/include/bits/stdlib.h:94: error: too many arguments to function ‘__wctomb_chk’
/usr/include/bits/stdlib.h: At top level:
/usr/include/bits/stdlib.h:99: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__mbstowcs_chk’
/usr/include/bits/stdlib.h:102: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__mbstowcs_alias’
/usr/include/bits/stdlib.h:106: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__mbstowcs_chk_warn’
/usr/include/bits/stdlib.h:114: error: expected ‘,’ or ‘;’ before ‘mbstowcs’
/usr/include/bits/stdlib.h:131: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__wcstombs_chk’
/usr/include/bits/stdlib.h:134: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__wcstombs_alias’
/usr/include/bits/stdlib.h:138: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__wcstombs_chk_warn’
/usr/include/bits/stdlib.h:145: error: expected ‘,’ or ‘;’ before ‘wcstombs’
prog.c: In function ‘main’:
prog.c:24: warning: implicit declaration of function ‘malloc’
prog.c:24: warning: incompatible implicit declaration of built-in function ‘malloc’
prog.c: In function ‘print_stack_list’:
prog.c:62: error: expected expression before ‘)’ token
stdout
Standard output is empty