Skip to content

Commit

Permalink
Add -Wstrict-prototypes and fix offending functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nwellnhof authored and jgm committed Jan 24, 2022
1 parent 72549a2 commit 9c8e834
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ function(cmark_add_compile_options target)
endif()
target_compile_definitions(${target} PRIVATE _CRT_SECURE_NO_WARNINGS)
else()
target_compile_options(${target} PRIVATE -Wall -Wextra -pedantic)
target_compile_options(${target} PRIVATE
-Wall -Wextra -pedantic
$<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes>)
endif()
if(CMAKE_BUILD_TYPE MATCHES profile)
target_compile_options(${target} PRIVATE -pg)
Expand Down
2 changes: 1 addition & 1 deletion api_test/harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "harness.h"

test_batch_runner *test_batch_runner_new() {
test_batch_runner *test_batch_runner_new(void) {
return (test_batch_runner *)calloc(1, sizeof(test_batch_runner));
}

Expand Down
2 changes: 1 addition & 1 deletion api_test/harness.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef struct {
int num_skipped;
} test_batch_runner;

test_batch_runner *test_batch_runner_new();
test_batch_runner *test_batch_runner_new(void);

void SKIP(test_batch_runner *runner, int num_tests);

Expand Down
2 changes: 1 addition & 1 deletion api_test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ static void ref_source_pos(test_batch_runner *runner) {
cmark_node_free(doc);
}

int main() {
int main(void) {
int retval;
test_batch_runner *runner = test_batch_runner_new();

Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typedef enum {
FORMAT_LATEX
} writer_format;

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

0 comments on commit 9c8e834

Please sign in to comment.