Skip to content

Commit

Permalink
pkg/cover: fix gcc build error due to warning triggered by -Wint-conv…
Browse files Browse the repository at this point in the history
…ersion

This error has appeared on Fedora 40 s390x with gcc 14.0.1.

$ go test -v -count=1 -short ./pkg/cover

/tmp/TestReportGeneratorlinux-s390xmismatch-pcs2143164880/001/kcov.c:20:33:
  error: pointer/integer type mismatch in conditional expression
  [-Wint-conversion]
20 |        return map ? map->l_addr : NULL;
   |                                 ^
At top level:
cc1: note: unrecognized command-line option
     '-Wno-unused-command-line-argument' may have been intended to silence
     earlier diagnostics

Signed-off-by: Alexander Egorenkov <eaibmz@gmail.com>
  • Loading branch information
eaibmz committed Jun 3, 2024
1 parent 3113787 commit 043d53a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cover/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void* aslr_base() {
dlinfo(handle, RTLD_DI_LINKMAP, &map);
dlclose(handle);
}
return map ? map->l_addr : NULL;
return map ? (void *)map->l_addr : NULL;
}
#else
void* aslr_base() { return NULL; }
Expand Down

0 comments on commit 043d53a

Please sign in to comment.