Skip to content

Conversation

@daneos
Copy link
Contributor

@daneos daneos commented Oct 16, 2025

Attempt to clean up warnings.

Warnings still left to clean up:

  ../nfs_utils.c:118:5: warning: implicit declaration of function ‘iocshSetError’ [-Wimplicit-function-declaration]
    118 |     iocshSetError(save_restoreSet_NFSHost(args[0].sval, args[1].sval, args[2].sval));
        |     ^~~~~~~~~~~~~

Happens only with base 3.15, where iocshSetError doesn't seem to exist. I'm not entirely sure why it doesn't fail the build instead.

  ../save_restore.c: In function ‘concatenate_paths’:
  ../save_restore.c:754:9: warning: ‘__builtin_strncat’ output may be truncated copying between 0 and 254 bytes from a string of length 254 [-Wstringop-truncation]
    754 |         strncat(dest, &(tmp2[1]), MAX(MAX_PATH_LEN - 1 - strlen(dest), 0));
        |         ^
  ../save_restore.c:756:9: warning: ‘__builtin_strncat’ output may be truncated copying between 0 and 254 bytes from a string of length 254 [-Wstringop-truncation]
    756 |         strncat(dest, tmp2, MAX(MAX_PATH_LEN - 1 - strlen(dest), 0));
        |         ^

Fixing this would require either some heavy-ish refactoring of concatenate_paths or providing it with the size of dest buffer.

@daneos daneos force-pushed the fix_warnings branch 3 times, most recently from cf41cf3 to b8f1d5e Compare October 21, 2025 13:07
@daneos daneos marked this pull request as ready for review October 21, 2025 13:34
tmpnam can lead to race conditions where temporary file is opened by
another process in the time between tmpnam and fopen calls.

This change requires slight modification in do_asVerify as it now needs
to accept either file name or a file pointer returned by tmpfile.
@anderslindho anderslindho merged commit d7bcdf2 into epics-modules:master Nov 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants