File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ CFLAGS += -D_GNU_SOURCE
12CFLAGS += -Wall
23CFLAGS += -pedantic-errors
34
45draft : draft.c
56 $(CC ) $(CFLAGS ) -fno-omit-frame-pointer -g -o draft $^
67
78barf : draft.c
8- $(CC ) $(CFLAGS ) -fno-omit-frame-pointer -S $^ | tee draft.s
9+ $(CC ) $(CFLAGS ) -fno-omit-frame-pointer -S $^ -o draft.s
910
1011debug : barf
1112 $(CC ) -o draft draft.s -g
Original file line number Diff line number Diff line change 22#include <sys/stat.h>
33#include <stddef.h>
44#include <stdlib.h>
5+ #include <unistd.h>
6+ #include <sys/syscall.h>
7+ #include <sys/types.h>
58
69int fh = 0 ;
10+ int i = 0 ;
711
812int main (int argc , char * argv [])
913{
10- fh = 3 ;
11- printf ("%d\n" , fh );
14+ char out [5 ];
15+ out [i ++ ] = '0' ;
16+ out [i ++ ] = 'x' ;
17+ out [i ++ ] = '4' ;
18+ out [i ++ ] = '1' ;
19+ out [i ++ ] = '\n' ;
20+ syscall (__NR_write , 1 , out , 5 );
1221 return 0 ;
1322}
You can’t perform that action at this time.
0 commit comments