Skip to content

Instantly share code, notes, and snippets.

@ageldama
Created October 12, 2019 01:19
Show Gist options
  • Save ageldama/0a206224512785e0feeb8a238d2c47f0 to your computer and use it in GitHub Desktop.
Save ageldama/0a206224512785e0feeb8a238d2c47f0 to your computer and use it in GitHub Desktop.
m.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
3 | main() {
| ^~~~
m.c: In function ‘main’:
m.c:4:16: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
4 | printf("%p\n", malloc(0));
| ^~~~~~
m.c:4:16: warning: incompatible implicit declaration of built-in function ‘malloc’
m.c:2:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
1 | #include <stdio.h>
+++ |+#include <stdlib.h>
2 |
arch-desktop :: ~/w » ./a.out
0x55ec86e5b2a0
#include <stdio.h>
main() {
printf("%p\n", malloc(0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment