Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning while compiling with GCC on linux #124

Open
abhin4v opened this issue Jan 26, 2022 · 0 comments
Open

Warning while compiling with GCC on linux #124

abhin4v opened this issue Jan 26, 2022 · 0 comments

Comments

@abhin4v
Copy link

abhin4v commented Jan 26, 2022

Compiling with GCC on linux with warnings on throws these warnings:

runtime.c: In function ‘print_heap’:
runtime.c:587:18: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘long int’ [-Wformat=]
  587 |       printf("%lld", (int64_t)*root_loc);
      |               ~~~^   ~~~~~~~~~~~~~~~~~~
      |                  |   |
      |                  |   long int
      |                  long long int
      |               %ld
runtime.c: In function ‘print_vector’:
runtime.c:601:14: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘long int’ [-Wformat=]
  601 |   printf("%lld=#(", (int64_t)vector_ptr);
      |           ~~~^      ~~~~~~~~~~~~~~~~~~~
      |              |      |
      |              |      long int
      |              long long int
      |           %ld
runtime.c:608:18: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘long int’ [-Wformat=]
  608 |       printf("%lld", (int64_t)*scan_ptr);
      |               ~~~^   ~~~~~~~~~~~~~~~~~~
      |                  |   |
      |                  |   long int
      |                  long long int
      |               %ld
runtime.c: In function ‘read_int’:
runtime.c:504:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  504 |   scanf("%" SCNd64, &i);
      |   ^~~~~~~~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant