Skip to content
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
34 changes: 34 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,37 @@ jobs:
exit 1
fi
echo "Exported symbols match the baseline."

missing-declarations:
# A function defined without a prior declaration is either missing
# from its header or should have been static. Both shapes reached
# master before, because the flag is in the project's clean set but
# nothing makes it fatal, and a warning in a build that passes is
# not read.
#
# Promoting this one flag needs no preparatory cleanup. The whole
# NIFTI_WARNINGS_AS_ERRORS set is still blocked by
# -Wmaybe-uninitialized in fslio.c, and waiting for that would
# leave this uncovered meanwhile.
name: no undeclared external functions (FSLSTYLE=${{ matrix.fslstyle }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fslstyle: ["OFF", "ON"]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libexpat1-dev zlib1g-dev ninja-build
- name: Configure CMake
run: >
cmake -G Ninja -B ${{ github.workspace }}/build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_FLAGS=-Werror=missing-declarations
-DNIFTI_BUILD_APPLICATIONS=ON
-DUSE_CIFTI_CODE=ON
-DUSE_FSL_CODE=ON
-DFSLSTYLE=${{ matrix.fslstyle }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ github.workspace }}/build
4 changes: 2 additions & 2 deletions nifti2/nifti2_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7904,7 +7904,7 @@ znzFile nifti_image_write_hdr_img2(nifti_image *nim, int write_opts,

#ifdef PIGZ
#ifdef HAVE_ZLIB
int doPigz2(nifti_image *nim, struct nifti_2_header nhdr, const nifti_brick_list * NBL) {
static int doPigz2(nifti_image *nim, struct nifti_2_header nhdr, const nifti_brick_list * NBL) {
FILE *pigzPipe;
char command[768];
strcpy(command, "pigz" );
Expand Down Expand Up @@ -7936,7 +7936,7 @@ int doPigz2(nifti_image *nim, struct nifti_2_header nhdr, const nifti_brick_list
return 0;
}

int doPigz(nifti_image *nim, struct nifti_1_header nhdr, const nifti_brick_list * NBL) {
static int doPigz(nifti_image *nim, struct nifti_1_header nhdr, const nifti_brick_list * NBL) {
FILE *pigzPipe;
char command[768];
strcpy(command, "pigz" );
Expand Down
4 changes: 3 additions & 1 deletion niftilib/nifti1_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -5798,6 +5798,7 @@ znzFile nifti_image_write_hdr_img2(nifti_image *nim, int write_opts,

#ifdef PIGZ
#ifdef HAVE_ZLIB
#if 0 /* unused here: identical to doPigz below */
int doPigz2(nifti_image *nim, struct nifti_1_header nhdr, const nifti_brick_list * NBL) {
FILE *pigzPipe;
char command[768];
Expand Down Expand Up @@ -5829,8 +5830,9 @@ int doPigz2(nifti_image *nim, struct nifti_1_header nhdr, const nifti_brick_list
free(fp);
return 0;
}
#endif

int doPigz(nifti_image *nim, struct nifti_1_header nhdr, const nifti_brick_list * NBL) {
static int doPigz(nifti_image *nim, struct nifti_1_header nhdr, const nifti_brick_list * NBL) {
FILE *pigzPipe;
char command[768];
strcpy(command, "pigz" );
Expand Down
Loading