Skip to content

Commit 9c8e834

Browse files
nwellnhofjgm
authored andcommitted
Add -Wstrict-prototypes and fix offending functions
1 parent 72549a2 commit 9c8e834

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ function(cmark_add_compile_options target)
4444
endif()
4545
target_compile_definitions(${target} PRIVATE _CRT_SECURE_NO_WARNINGS)
4646
else()
47-
target_compile_options(${target} PRIVATE -Wall -Wextra -pedantic)
47+
target_compile_options(${target} PRIVATE
48+
-Wall -Wextra -pedantic
49+
$<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes>)
4850
endif()
4951
if(CMAKE_BUILD_TYPE MATCHES profile)
5052
target_compile_options(${target} PRIVATE -pg)

api_test/harness.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "harness.h"
77

8-
test_batch_runner *test_batch_runner_new() {
8+
test_batch_runner *test_batch_runner_new(void) {
99
return (test_batch_runner *)calloc(1, sizeof(test_batch_runner));
1010
}
1111

api_test/harness.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ typedef struct {
1212
int num_skipped;
1313
} test_batch_runner;
1414

15-
test_batch_runner *test_batch_runner_new();
15+
test_batch_runner *test_batch_runner_new(void);
1616

1717
void SKIP(test_batch_runner *runner, int num_tests);
1818

api_test/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ static void ref_source_pos(test_batch_runner *runner) {
10671067
cmark_node_free(doc);
10681068
}
10691069

1070-
int main() {
1070+
int main(void) {
10711071
int retval;
10721072
test_batch_runner *runner = test_batch_runner_new();
10731073

src/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ typedef enum {
2828
FORMAT_LATEX
2929
} writer_format;
3030

31-
void print_usage() {
31+
void print_usage(void) {
3232
printf("Usage: cmark [FILE*]\n");
3333
printf("Options:\n");
3434
printf(" --to, -t FORMAT Specify output format (html, xml, man, "

0 commit comments

Comments
 (0)