From 7f059bef13b4e7342c38cd03d8af49af39b680fa Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Fri, 10 Jun 2022 14:53:48 +0200 Subject: [PATCH] common.mak: fix `-Wnewline-eof` in `check_header_prereq` and `check_dep` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit printf "#include <%s>\n int main(void) {return 0;}" "glib.h" | ( clang -DS390_TOOLS_RELEASE=2.21.0-build-20220609 -DS390_TOOLS_LIBDIR=/lib/s390-tools -DS390_TOOLS_DATADIR=/usr/share/s390-tools -DS390_TOOLS_SYSCONFDIR=/etc -DS390_TOOLS_BINDIR=/sbin -g -fstack-protector-all -W -Wall -Wformat-security -O3 -std=gnu11 -DOPENSSL_API_COMPAT=0x10101000L -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -Wall -Wextra -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wno-long-long -Wuninitialized -Wconversion -Wstrict-prototypes -Wpointer-arith -Wno-error=inline -Wpedantic -Werror -fPIC -I ../include -D_GNU_SOURCE -o /dev/null -xc - ) :2:28: error: no newline at end of file [-Werror,-Wnewline-eof] int main(void) {return 0;} ^ 1 error generated. Signed-off-by: Marc Hartmayer Reviewed-by: Alexander Egorenkov Signed-off-by: Jan Höppner --- common.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.mak b/common.mak index 1296f248..637e91dd 100644 --- a/common.mak +++ b/common.mak @@ -118,7 +118,7 @@ endif # Returns "yes" on success and nothing otherwise # define check_header_prereq -$(shell printf "#include <%s>\n int main(void) {return 0;}" $1 | \ +$(shell printf "#include <%s>\n int main(void) {return 0;}\n" $1 | \ ( $(CC) $(filter-out --coverage, $(ALL_CFLAGS)) $(ALL_CPPFLAGS) \ $2 -o /dev/null -xc - ) >/dev/null 2>&1 && echo -n yes) endef @@ -133,7 +133,7 @@ endef # $5: Additional compiler & linker options (optional) # check_dep=\ -printf "\#include <%s>\n int main(void) {return 0;}" $2 | ( $(CC) $(filter-out --coverage, $(ALL_CFLAGS)) $(ALL_CPPFLAGS) $5 -o /dev/null -xc - ) > /dev/null 2>&1; \ +printf "\#include <%s>\n int main(void) {return 0;}\n" $2 | ( $(CC) $(filter-out --coverage, $(ALL_CFLAGS)) $(ALL_CPPFLAGS) $5 -o /dev/null -xc - ) > /dev/null 2>&1; \ if [ $$? != 0 ]; \ then \ printf " REQCHK %s (%s)\n" $1 $2; \