1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Unbreak the gcc build with sendfile_test after r343362

gcc 8.x is more pedantic than clang 7.x with format strings and the tests
passed `void*` variables while supplying `%s` (which is technically
incorrect).

Make the affected `void*` variables use `char*` storage instead to address
this issue, as the compiler will upcast the values to `char*`.

MFC after:	1 month
MFC with:	r343362
Approved by:	emaste (mentor; implicit)
Reviewed by:	asomers
Differential Revision: https://reviews.freebsd.org/D18934
This commit is contained in:
Enji Cooper 2019-01-23 23:06:39 +00:00
parent 49cf58e559
commit de00e09d82
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343365

View File

@ -195,7 +195,7 @@ setup_server(int domain, int type, int port)
static void
server_cat(const char *dest_filename, int server_sock, size_t len)
{
void *buffer;
char *buffer;
int recv_sock;
ssize_t received_bytes;
@ -268,7 +268,7 @@ static void
verify_source_and_dest(const char* dest_filename, int src_fd, off_t offset,
size_t nbytes)
{
void *dest_pointer, *src_pointer;
char *dest_pointer, *src_pointer;
off_t dest_file_size, src_file_size;
size_t length;
int dest_fd;
@ -384,7 +384,7 @@ ATF_TC_BODY(fd_positive_file_v6, tc)
static void
fd_positive_shm_test(int domain)
{
void *shm_pointer;
char *shm_pointer;
off_t offset;
size_t nbytes, pattern_size;
pid_t server_pid;
@ -687,9 +687,9 @@ hdtr_positive_test(int domain)
client_sock = setup_tcp_client(domain, port);
rc = asprintf(&pattern, "%s%s%s",
testcases[i].include_headers ? headers[0].iov_base : "",
testcases[i].include_headers ? (char *)headers[0].iov_base : "",
DETERMINISTIC_PATTERN,
testcases[i].include_trailers ? trailers[0].iov_base : "");
testcases[i].include_trailers ? (char *)trailers[0].iov_base : "");
ATF_REQUIRE_MSG(rc != -1, "asprintf failed: %s", strerror(errno));
atf_utils_create_file(SOURCE_FILE ".full", "%s", pattern);