Add -Wstrict-prototypes and fix offending functions

This commit is contained in:
Nick Wellnhofer 2022-01-24 12:23:31 +01:00 committed by John MacFarlane
parent 72549a214a
commit 9c8e834136
5 changed files with 7 additions and 5 deletions

View File

@ -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)

View File

@ -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));
}

View File

@ -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);

View File

@ -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();

View File

@ -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, "