From 9f37797e68febd9f35715f85fcee146366b81ca8 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 31 May 2022 11:31:19 -0400 Subject: Makefile: Pass -std=gnu11 for gcov builds Otherwise, libgcov doesn't intercept functions like fork() and exec(), so we lose some coverage data in xspawn.c. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82457 --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index d368cf8..b521b30 100644 --- a/Makefile +++ b/Makefile @@ -160,6 +160,8 @@ endif ifneq ($(filter gcov,$(MAKECMDGOALS)),) LOCAL_CFLAGS += --coverage +# gcov only intercepts fork()/exec() with -std=gnu* +LOCAL_CFLAGS := $(patsubst -std=c%,-std=gnu%,$(LOCAL_CFLAGS)) endif ifneq ($(filter release,$(MAKECMDGOALS)),) -- cgit v1.2.3