Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -Wstrict-prototypes and fix offending functions #436

Merged
merged 1 commit into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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