Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Multiple warnings on compile #2

Open
LeamHall opened this issue Aug 10, 2024 · 0 comments
Open

Multiple warnings on compile #2

LeamHall opened this issue Aug 10, 2024 · 0 comments

Comments

@LeamHall
Copy link
Member

$ make
cc ssv.c -o ssv  -lX11
ssv.c:260:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
  260 | main(argc,argv)
      | ^~~~
ssv.c: In function ‘main’:
ssv.c:274:33: warning: implicit declaration of function ‘usage’ [-Wimplicit-function-declaration]
  274 |   if ((argc > 3) || (argc < 2)) usage();
      |                                 ^~~~~
ssv.c:286:7: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]
  286 |       exit(1); }
      |       ^~~~
ssv.c:70:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
   69 | #include "bitmaps/zhodane.xbm"
  +++ |+#include <stdlib.h>
   70 | 
ssv.c:286:7: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  286 |       exit(1); }
      |       ^~~~
ssv.c:286:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
ssv.c:290:7: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  290 |       exit(1); }
      |       ^~~~
ssv.c:290:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
ssv.c:297:7: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  297 |       exit(1); }
      |       ^~~~
ssv.c:297:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
ssv.c:301:7: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  301 |       exit(1); }
      |       ^~~~
ssv.c:301:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
ssv.c:305:7: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  305 |       exit(1); }
      |       ^~~~
ssv.c:305:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
ssv.c:388:5: warning: implicit declaration of function ‘print_subsector’ [-Wimplicit-function-declaration]
  388 |     print_subsector();
      |     ^~~~~~~~~~~~~~~
ssv.c:407:19: warning: implicit declaration of function ‘gen_sector’ [-Wimplicit-function-declaration]
  407 |                   gen_sector(win);
      |                   ^~~~~~~~~~
ssv.c:415:19: warning: implicit declaration of function ‘repaint_buttons’ [-Wimplicit-function-declaration]
  415 |                   repaint_buttons();
      |                   ^~~~~~~~~~~~~~~
ssv.c:419:41: warning: passing argument 1 of ‘XRefreshKeyboardMapping’ from incompatible pointer type [-Wincompatible-pointer-types]
  419 |               XRefreshKeyboardMapping ( &event);
      |                                         ^~~~~~
      |                                         |
      |                                         XEvent *
In file included from ssv.c:36:
/usr/include/X11/Xlib.h:3082:5: note: expected ‘XMappingEvent *’ but argument is of type ‘XEvent *’
 3082 |     XMappingEvent*      /* event_map */
      |     ^~~~~~~~~~~~~~
ssv.c:423:17: warning: implicit declaration of function ‘mark_border’ [-Wimplicit-function-declaration]
  423 |                 mark_border();
      |                 ^~~~~~~~~~~
ssv.c:463:33: warning: passing argument 1 of ‘XLookupString’ from incompatible pointer type [-Wincompatible-pointer-types]
  463 |               i = XLookupString(&event, text, 10, &key, NULL);
      |                                 ^~~~~~
      |                                 |
      |                                 XEvent *
In file included from ssv.c:37:
/usr/include/X11/Xutil.h:535:5: note: expected ‘XKeyEvent *’ but argument is of type ‘XEvent *’
  535 |     XKeyEvent*          /* event_struct */,
      |     ^~~~~~~~~~
ssv.c:471:3: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  471 |   exit(0);
      |   ^~~~
ssv.c:471:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
ssv.c: At top level:
ssv.c:474:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
  474 | gen_sector(d)
      | ^~~~~~~~~~
ssv.c:666:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
  666 | load_sector_file(argc, argv)
      | ^~~~~~~~~~~~~~~~
ssv.c: In function ‘load_sector_file’:
ssv.c:678:7: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  678 |       exit(1); }
      |       ^~~~
ssv.c:678:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
ssv.c:695:7: warning: implicit declaration of function ‘load_bdr_seg’ [-Wimplicit-function-declaration]
  695 |       load_bdr_seg(line);
      |       ^~~~~~~~~~~~
ssv.c:703:18: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  703 |       t_start[4] = NULL;
      |                  ^
ssv.c:704:16: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  704 |       t_end[4] = NULL;
      |                ^
ssv.c:705:17: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  705 |       offset[4] = NULL;
      |                 ^
ssv.c:707:14: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  707 |       str[2] = NULL;
      |              ^
ssv.c:708:29: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
  708 |       t_route[tr_cnt].x1 = (atoi(str) - 1) % 8;
      |                             ^~~~
ssv.c:710:14: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  710 |       str[2] = NULL;
      |              ^
ssv.c:713:14: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  713 |       str[2] = NULL;
      |              ^
ssv.c:716:14: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  716 |       str[2] = NULL;
      |              ^
ssv.c:720:14: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  720 |       str[2] = NULL;
      |              ^
ssv.c:729:14: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  729 |       str[2] = NULL;
      |              ^
ssv.c:746:18: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  746 |       w->name[0] = NULL;
      |                  ^
ssv.c:749:20: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  749 |       w->name[i+2] = NULL;
      |                    ^
ssv.c:753:15: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  753 |     w->hex[4] = NULL;
      |               ^
ssv.c:757:20: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  757 |     w->Starport[1] = NULL;
      |                    ^
ssv.c:768:15: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  768 |     w->uwp[8] = NULL;
      |               ^
ssv.c:772:16: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  772 |     w->Base[1] = NULL;
      |                ^
ssv.c:775:54: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  775 |     if ((w->notes[0] = line[32]) == ' ') w->notes[0] = NULL;
      |                                                      ^
ssv.c:778:58: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  778 |         if ((w->notes[2] = line[35]) == ' ') w->notes[2] = NULL;
      |                                                          ^
ssv.c:781:62: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  781 |             if ((w->notes[4] = line[38]) == ' ') w->notes[4] = NULL;
      |                                                              ^
ssv.c:784:66: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  784 |                 if ((w->notes[6] = line[41]) == ' ') w->notes[6] = NULL;
      |                                                                  ^
ssv.c:787:70: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  787 |                     if ((w->notes[8] = line[44]) == ' ') w->notes[8] = NULL;
      |                                                                      ^
ssv.c:790:38: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  790 |                         w->notes[10] = NULL;
      |                                      ^
ssv.c:799:16: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  799 |     w->Zone[1] = NULL;
      |                ^
ssv.c:803:22: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  803 |     w->allegiance[2] = NULL;
      |                      ^
ssv.c:807:12: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  807 |     str[1] = NULL;
      |            ^
ssv.c:812:12: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  812 |     str[2] = NULL;
      |            ^
ssv.c:815:12: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  815 |     str[2] = NULL;
      |            ^
ssv.c:820:12: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  820 |     str[1] = NULL;
      |            ^
ssv.c:831:12: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  831 |     str[1] = NULL;
      |            ^
ssv.c: At top level:
ssv.c:871:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
  871 | load_bdr_seg(str)
      | ^~~~~~~~~~~~
ssv.c: In function ‘load_bdr_seg’:
ssv.c:880:14: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  880 |   bdr_hex[2] = NULL;
      |              ^
ssv.c:884:14: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  884 |   bdr_hex[2] = NULL;
      |              ^
ssv.c:887:16: warning: assignment to ‘char’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  887 |   edge_char[1] = NULL;
      |                ^
ssv.c: At top level:
ssv.c:900:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
  900 | print_sector_file()
      | ^~~~~~~~~~~~~~~~~
ssv.c:933:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
  933 | repaint_buttons()
      | ^~~~~~~~~~~~~~~
ssv.c:958:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
  958 | mark_border()
      | ^~~~~~~~~~~
ssv.c:1025:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 1025 | print_subsector()
      | ^~~~~~~~~~~~~~~
ssv.c: In function ‘print_subsector’:
ssv.c:1049:16: warning: comparison between pointer and integer
 1049 |   if (PrintPix == NULL)
      |                ^~
ssv.c:1073:18: warning: implicit declaration of function ‘Get_Colors’ [-Wimplicit-function-declaration]
 1073 |   if ((ncolors = Get_Colors(&colors)) == 0)
      |                  ^~~~~~~~~~
ssv.c:1110:5: warning: implicit declaration of function ‘_swaplong’ [-Wimplicit-function-declaration]
 1110 |     _swaplong((char *) &header, sizeof(header));
      |     ^~~~~~~~~
ssv.c:1113:9: warning: implicit declaration of function ‘_swapshort’ [-Wimplicit-function-declaration]
 1113 |         _swapshort((char *) &colors[i].red, 3 * sizeof(short));
      |         ^~~~~~~~~~
ssv.c:1128:19: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration]
 1128 |   if(ncolors > 0) free(colors);
      |                   ^~~~
ssv.c:1128:19: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’
ssv.c:1128:19: warning: incompatible implicit declaration of built-in function ‘free’ [-Wbuiltin-declaration-mismatch]
ssv.c:1128:19: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’
ssv.c: At top level:
ssv.c:1152:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 1152 | Get_Colors(colors)
      | ^~~~~~~~~~
ssv.c: In function ‘Get_Colors’:
ssv.c:1159:29: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
 1159 |   if ((*colors = (XColor *) malloc (sizeof(XColor) * ncolors)) == NULL)
      |                             ^~~~~~
ssv.c:1159:29: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
ssv.c:1159:29: warning: incompatible implicit declaration of built-in function ‘malloc’ [-Wbuiltin-declaration-mismatch]
ssv.c:1159:29: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
ssv.c: At top level:
ssv.c:1170:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 1170 | _swapshort (bp, n)
      | ^~~~~~~~~~
ssv.c:1187:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 1187 | _swaplong (bp, n)
      | ^~~~~~~~~
ssv.c:1210:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 1210 | usage()
      | ^~~~~
ssv.c: In function ‘usage’:
ssv.c:1213:3: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
 1213 |   exit(1);
      |   ^~~~
ssv.c:1213:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant