Embed Notice
HTML Code
Corresponding Notice
- Embed this notice@kirby @usernameswift yeah ok I think it worked fuck me
Makefile:
CC=gcc
CFLAGS = -ggdb
CPPFLAGS = -c -std=gnu90 -Wall -pedantic -Wextra
NES = -z noexecstack
mycode.o: mycode.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(NES) -o mycode.o -c mycode.c
mycode: mycode.o
$(CC) $(NES) -o mycode mycode.o
Code:
#include <stdlib.h>
int main(){
int *i;
i = malloc(sizeof(int));
*i = 12;
free(i);
return 0;
}
Compilation Output:
gcc -ggdb -c -std=gnu90 -Wall -pedantic -Wextra -z noexecstack -o mycode.o -c mycode.c
gcc -z noexecstack -o mycode mycode.o