diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-31 16:50:46 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-31 16:50:46 +0900 |
| commit | e09613812ce955c074238e8c91a0ed6eca3dc86f (patch) | |
| tree | 37977776e60529abb1ee98098ac1364c02e4269b /src/preprocess.c | |
| parent | 54699e921e23a684c711773b123c1bcfecd91ae0 (diff) | |
| download | ducc-e09613812ce955c074238e8c91a0ed6eca3dc86f.tar.gz ducc-e09613812ce955c074238e8c91a0ed6eca3dc86f.tar.zst ducc-e09613812ce955c074238e8c91a0ed6eca3dc86f.zip | |
feat: enable -Wall flag on build
Diffstat (limited to 'src/preprocess.c')
| -rw-r--r-- | src/preprocess.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/preprocess.c b/src/preprocess.c index 03a2121..b1753c2 100644 --- a/src/preprocess.c +++ b/src/preprocess.c @@ -690,12 +690,12 @@ static const char* resolve_include_name(Preprocessor* pp, const Token* include_n char* current_filename = strdup(include_name_token->loc.filename); const char* current_dir = dirname(current_filename); char* buf = calloc(strlen(include_name) - 2 + 1 + strlen(current_dir) + 1, sizeof(char)); - sprintf(buf, "%s/%.*s", current_dir, strlen(include_name) - 2, include_name + 1); + sprintf(buf, "%s/%.*s", current_dir, INT_CAST strlen(include_name) - 2, include_name + 1); return buf; } else { for (int i = 0; i < pp->n_include_paths; ++i) { char* buf = calloc(strlen(include_name) - 2 + 1 + strlen(pp->include_paths[i]) + 1, sizeof(char)); - sprintf(buf, "%s/%.*s", pp->include_paths[i], strlen(include_name) - 2, include_name + 1); + sprintf(buf, "%s/%.*s", pp->include_paths[i], INT_CAST strlen(include_name) - 2, include_name + 1); if (access(buf, F_OK | R_OK) == 0) { return buf; } @@ -1286,7 +1286,6 @@ static void preprocess_text_line(Preprocessor* pp) { // '#' 'pragma' ... // '#' new-line static void preprocess_group_part(Preprocessor* pp) { - int first_token_pos = pp->pos; Token* tok = peek_pp_token(pp); if (tok->kind == TokenKind_pp_directive_if || tok->kind == TokenKind_pp_directive_ifdef || tok->kind == TokenKind_pp_directive_ifndef) { |
