Skip to content

Commit

Permalink
[LibOS] Add "unused" attribute to variable read_from_in
Browse files Browse the repository at this point in the history
The variable is indeed unused but may be helpful once we improve
`sendfile()` implementation. Newer Clang (e.g. v14) complains about this
unused variable, so let's silence Clang by adding the attribute.

Signed-off-by: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com>
  • Loading branch information
dimakuv committed Dec 15, 2023
1 parent a369419 commit 7e260b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libos/src/sys/libos_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,10 @@ long libos_syscall_sendfile(int out_fd, int in_fd, off_t* offset, size_t count)
long ret;
char* buf = NULL;

size_t read_from_in = 0;
/* "unused" to silence newer Clang; we keep this variable as it may be helpful once we improve
* the `sendfile()` implementation, see one of the TODOs below */
__attribute__((unused)) size_t read_from_in = 0;

size_t copied_to_out = 0;

if (offset && !is_user_memory_writable(offset, sizeof(*offset)))
Expand Down

0 comments on commit 7e260b1

Please sign in to comment.