summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-08-02 13:16:44 -0400
committerJakob Kaivo <jkk@ung.org>2019-08-02 13:16:44 -0400
commit94375bb322851a501f96814140916158120997d4 (patch)
tree18fd1aa53be38764f984e663f37e25c703b91999
parent61e4c607d2e0514683a8b2a9e7667e85e2b53780 (diff)
compile cleanly with more warnings enabled
-rw-r--r--Makefile2
-rw-r--r--env.c3
-rw-r--r--input.c5
-rw-r--r--io.c4
-rw-r--r--re.c10
-rw-r--r--signals.c1
-rw-r--r--stubs.c22
7 files changed, 28 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 2311579..6e68f88 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
default: all
-CFLAGS=-g -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter
+CFLAGS=-g -Wall -Wextra -Wpedantic -Werror
UTILITY=ed
SOURCES=ed.c commands.c stubs.c env.c io.c signals.c input.c re.c
HEADERS=ed.h
diff --git a/env.c b/env.c
index a90b8ea..86cef9b 100644
--- a/env.c
+++ b/env.c
@@ -53,6 +53,7 @@ void ed_error(const char *fmt, ...)
void ed_filename(intmax_t start, intmax_t end, const char *arg)
{
+ (void)start; (void)end;
if (ed_state.filename) {
free(ed_state.filename);
}
@@ -62,6 +63,7 @@ void ed_filename(intmax_t start, intmax_t end, const char *arg)
void ed_help(intmax_t start, intmax_t end, const char *arg)
{
+ (void)start; (void)end; (void)arg;
if (ed_state.help) {
puts(ed_state.help);
}
@@ -77,6 +79,7 @@ void ed_help_mode(intmax_t start, intmax_t end, const char *arg)
void ed_prompt(intmax_t start, intmax_t end, const char *arg)
{
+ (void)start; (void)end; (void)arg;
if (ed_state.prompt == NULL) {
ed_state.prompt = "*";
}
diff --git a/input.c b/input.c
index 99b27d4..f8a086c 100644
--- a/input.c
+++ b/input.c
@@ -49,11 +49,12 @@ static struct ed_line *ed_input(void)
return head;
}
-void ed_append(intmax_t start, intmax_t end, const char *arg) { }
-void ed_change(intmax_t start, intmax_t end, const char *arg) { }
+void ed_append(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_change(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
void ed_insert(intmax_t start, intmax_t end, const char *arg)
{
+ (void)start; (void)end; (void)arg;
struct ed_line *input = ed_input();
insque(input, ed_state.current);
}
diff --git a/io.c b/io.c
index 8573a92..e173f74 100644
--- a/io.c
+++ b/io.c
@@ -63,6 +63,7 @@ void ed_Edit(intmax_t start, intmax_t end, const char *arg)
void ed_print(intmax_t start, intmax_t end, const char *arg)
{
+ (void)start; (void)end; (void)arg;
fputs(ed_state.current->text, stdout);
}
@@ -77,11 +78,13 @@ void ed_quit(intmax_t start, intmax_t end, const char *arg)
void ed_Quit(intmax_t start, intmax_t end, const char *arg)
{
+ (void)start; (void)end; (void)arg;
exit(0);
}
void ed_read(intmax_t start, intmax_t end, const char *arg)
{
+ (void)start; (void)end;
intmax_t total = 0;
FILE *f = NULL;
@@ -133,6 +136,7 @@ void ed_read(intmax_t start, intmax_t end, const char *arg)
void ed_write(intmax_t start, intmax_t end, const char *arg)
{
+ (void)start; (void)end;
intmax_t total = 0;
FILE *f = NULL;
diff --git a/re.c b/re.c
index 2ec335b..9b1af3a 100644
--- a/re.c
+++ b/re.c
@@ -19,10 +19,10 @@
#include "ed.h"
-void ed_global(intmax_t start, intmax_t end, const char *arg) { }
-void ed_Global(intmax_t start, intmax_t end, const char *arg) { }
+void ed_global(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_Global(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
-void ed_substitute(intmax_t start, intmax_t end, const char *arg) { }
+void ed_substitute(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
-void ed_global_non_matched(intmax_t start, intmax_t end, const char *arg) { }
-void ed_Global_non_matched(intmax_t start, intmax_t end, const char *arg) { }
+void ed_global_non_matched(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_Global_non_matched(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
diff --git a/signals.c b/signals.c
index 91d8a15..282870c 100644
--- a/signals.c
+++ b/signals.c
@@ -25,6 +25,7 @@
void ed_sigint(int sig)
{
+ (void)sig;
}
void ed_sighup(int sig)
diff --git a/stubs.c b/stubs.c
index bf6e626..e3793d4 100644
--- a/stubs.c
+++ b/stubs.c
@@ -19,17 +19,17 @@
#include "ed.h"
-void ed_delete(intmax_t start, intmax_t end, const char *arg) { }
+void ed_delete(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
-void ed_join(intmax_t start, intmax_t end, const char *arg) { }
-void ed_mark(intmax_t start, intmax_t end, const char *arg) { }
-void ed_list(intmax_t start, intmax_t end, const char *arg) { }
-void ed_move(intmax_t start, intmax_t end, const char *arg) { }
-void ed_number(intmax_t start, intmax_t end, const char *arg) { }
+void ed_join(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_mark(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_list(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_move(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_number(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
-void ed_copy(intmax_t start, intmax_t end, const char *arg) { }
-void ed_undo(intmax_t start, intmax_t end, const char *arg) { }
+void ed_copy(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_undo(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
-void ed_line_number(intmax_t start, intmax_t end, const char *arg) { }
-void ed_shell_escape(intmax_t start, intmax_t end, const char *arg) { }
-void ed_null(intmax_t start, intmax_t end, const char *arg) { }
+void ed_line_number(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_shell_escape(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }
+void ed_null(intmax_t start, intmax_t end, const char *arg) { (void)start; (void)end; (void)arg; }