paulfloyd / freebsd_valgrind

Git repo used to Upstream the FreeBSD Port of Valgrind
GNU General Public License v2.0
15 stars 4 forks source link

Conditional compilation of dhat/tests/copy.c #161

Closed paulfloyd closed 2 years ago

paulfloyd commented 2 years ago

According to Mark

In dhat/tests/copy.c, which test for && defined(GNUC)? Is mempcpy defined if GNUC isn't on freebsd?

And Ed

GNUC is a Clang built-in:

$ cc -x c -dM -E /dev/null | grep GNUC

define __GNUC_MINOR__ 2

define __GNUC_PATCHLEVEL__ 1

define GNUC_STDC_INLINE 1

define GNUC 4

mempcpy was added in:

commit ee37f64cf875255338f917a9da76c643cf59786c Author: Konstantin Belousov kib@FreeBSD.org Date: Wed Jul 14 18:41:36 2021 +0300

libc: add mempcpy(3) and wmempcpy(3)

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D31180

Testing (defined(VGO_freebsd) && defined(GNUC)) seems a bit strange - probably the right thing to do is just drop the GNUC condition now, and then also remove VGO_freebsd in several months, when all supported FreeBSD branches have mempcpy.

paulfloyd commented 2 years ago

Time to revisit this. What is the status on FreeBSD 13.0 13.1 and 14.0?

paulfloyd commented 2 years ago

commit 4fb52a67b5650ecc3c7d90d39ab2dc67b4476505 (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd pjfloyd@wanadoo.fr Date: Wed Jun 1 22:09:50 2022 +0200

Cleanup of str* and mem* functions

Add function checks to configure.ac
Use the configure HAVE_ macro rather than OS-dependent tests.
I suspect that a lot of the tests hve been obsolete for many
years. Add wrappers to FreeBSD.