Add -fPIE flag to Makefile
authorLukas Jiriste <ljiriste@student.42prague.com>
Thu, 28 Nov 2024 10:03:09 +0000 (11:03 +0100)
committerLukas Jiriste <ljiriste@student.42prague.com>
Thu, 28 Nov 2024 10:03:09 +0000 (11:03 +0100)
The -fPIE flag has something to do with position independent code. I
think I've encountered this problem before when using ft_printf, because
its ability to print pointer values (addresses).

Makefile

index 1e35d453a9280347c5f64f819dab5d8c873ab88e..ddf223df35049acf725f4592006c6fbf5facb392 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 CC := cc
-CFLAGS := -std=c99 -Wall -Wextra -Werror -Wpedantic
+CFLAGS := -std=c99 -Wall -Wextra -Werror -Wpedantic -fPIE
 AR := ar
 
 RM := rm -f