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

Multiple warnings on compile #2

Description

@LeamHall
$ make
cc -c -O main.c
main.c: In function ‘init’:
main.c:75:18: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
   75 |           seed = time(NULL);
      |                  ^~~~
main.c:15:1: note: ‘time’ is defined in header ‘<time.h>’; did you forget to ‘#include <time.h>’?
   14 | #include        "structs.h"
  +++ |+#include <time.h>
   15 | 
main.c: In function ‘generate_stellar_system’:
main.c:146:16: warning: implicit declaration of function ‘iterate_surface_temp’ [-Wimplicit-function-declaration]
  146 |                iterate_surface_temp(&(planet));
      |                ^~~~~~~~~~~~~~~~~~~~
main.c:149:6: warning: implicit declaration of function ‘display_system’ [-Wimplicit-function-declaration]
  149 |      display_system(first_planet);
      |      ^~~~~~~~~~~~~~
main.c: At top level:
main.c:153:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
  153 | main (argc, argv)
      | ^~~~
main.c: In function ‘main’:
main.c:172:37: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
  172 |                         flag_seed = atoi(&(*++c));
      |                                     ^~~~
cc -c -O accrete.c
accrete.c:14:14: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch]
   14 | extern char *malloc();
      |              ^~~~~~
accrete.c:12:1: note: ‘malloc’ is declared in header ‘<stdlib.h>’
   11 | #include        "structs.h"
  +++ |+#include <stdlib.h>
   12 | 
cc -c -O enviro.c
enviro.c: In function ‘vol_inventory’:
enviro.c:381:21: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
  381 |                     printf("Error: orbital zone not initialized correctly!\n");
      |                     ^~~~~~
enviro.c:4:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
    3 | #include        "structs.h"
  +++ |+#include <stdio.h>
    4 | 
enviro.c:381:21: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
  381 |                     printf("Error: orbital zone not initialized correctly!\n");
      |                     ^~~~~~
enviro.c:381:21: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
cc -c -O display.c
cc -c -O utils.c
utils.c: In function ‘random_number’:
utils.c:15:23: warning: implicit declaration of function ‘rand’ [-Wimplicit-function-declaration]
   15 |      return((((double)rand()) / (double)(RAND_MAX)) * range + inner);
      |                       ^~~~
cc -O -o accrete2 main.o accrete.o enviro.o display.o utils.o -lm
accrete2 made

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions