From 47fc92eabc296f9232de40ba33be9c2931613c57 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Thu, 22 Oct 2020 00:30:17 +0000
Subject: [PATCH] reordered makefile for linking compatibility, cast const to remove warning

---
 .dir-locals.el |    7 +++++++
 Makefile       |    4 ++--
 main.c         |    4 ++--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 0000000..712657c
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,7 @@
+((nil .
+	  ((eval .
+			 (let ((root (projectile-project-root)))
+			   (setq-local company-clang-arguments
+						   (list (concat "-I" root "include")))
+			   (setq-local flycheck-clang-include-path
+						   (list (concat root "include"))))))))
diff --git a/Makefile b/Makefile
index 548e7b4..420b74c 100644
--- a/Makefile
+++ b/Makefile
@@ -12,10 +12,10 @@
 default: dnscomp
 
 %.o: %c $(DEPS)
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) -c -o $@ $< $(CFLAGS)
 
 dnscomp: $(_OBJ)
-	$(CC) $(CFLAGS) -o $@ $^
+	$(CC) -o $@ $^ $(CFLAGS)
 
 .PHONY: clean
 clean:
diff --git a/main.c b/main.c
index edcc99d..00d3e50 100644
--- a/main.c
+++ b/main.c
@@ -65,10 +65,10 @@
 		num_hosts = NUM_HOSTNAMES + added_hosts;
 	}
 	for (int i = added_hosts; i < num_hosts; i++) {
-		add_hosts_server(&hosts, HOSTNAMES[i-added_hosts]);
+		add_hosts_server(&hosts, (char*)HOSTNAMES[i-added_hosts]);
 	}
 	for (int i = 0; i < NUM_DNS; i++) {
-		add_dns_server(&servers, DNS_SERVERS[i]);
+		add_dns_server(&servers, (char*)DNS_SERVERS[i]);
 	}
 	test_dns();
 	sort_servers(&servers);

--
Gitblit v1.10.0