Skip to content

Commit cbf6059

Browse files
Merge pull request #508 from Wuerfel21/W21-fix-warning-ci
Fix "no_warnings" CI check
2 parents 1a8cc7b + 57d6448 commit cbf6059

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/build_n_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
steps:
5050
- uses: actions/checkout@v4
5151
- name: make
52-
run: make "OPT=-Werror"
52+
run: make "OPT=-O2 -Werror"
5353

5454
test_offline:
5555
runs-on: ubuntu-24.04

mcpp/mcpp_system.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ void do_options(
333333
set_cplus_dir = TRUE;
334334

335335
/* Get current directory for -I option and #pragma once */
336-
(void)getcwd( cur_work_dir, PATHMAX);
336+
if (!getcwd( cur_work_dir, PATHMAX)) {
337+
cfatal("Bug: getcwd returned NULL. (%s)",strerror(errno),0,NULL);
338+
}
337339
#if SYS_FAMILY == SYS_WIN
338340
bsl2sl( cur_work_dir);
339341
#endif
@@ -914,7 +916,9 @@ char *NormalizePath(const char *path)
914916
if (is_full_path(path)) {
915917
return strdup(path);
916918
}
917-
(void)getcwd(curpath, PATHMAX);
919+
if (!getcwd( curpath, PATHMAX)) {
920+
cfatal("Bug: getcwd returned NULL. (%s)",strerror(errno),0,NULL);
921+
}
918922
return norm_path(curpath, path, FALSE, FALSE);
919923
}
920924

0 commit comments

Comments
 (0)