From a9d549c969f29d12875e9803ba2e9843b82c3025 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 30 Jun 2019 13:49:29 -0700 Subject: [PATCH] BFS: Set -std=c++11 in bfs_shell c++flags for gcc >= 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Required for use of non-static data member clang complains about this line in CheckVisitor.cpp: memset(&Control().stats, 0, sizeof(check_control::stats)); some explination: https://stackoverflow.com/questions/29359661/clang-error-invalid-use-of-non-static-data-member http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html Referencing a non-static data member inside a struct was retroactively made undefined in C++98 and only allowed on C++11 even though gcc permits the code to compile. No change to functionality intended. Thanks Jérôme and waddlesplash Change-Id: Ic6bc332cf2796c709584488c60a067cd341bf894 Reviewed-on: https://review.haiku-os.org/c/1503 Reviewed-by: Jérôme Duval Reviewed-by: Adrien Destugues --- src/tools/bfs_shell/Jamfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tools/bfs_shell/Jamfile b/src/tools/bfs_shell/Jamfile index 5f79a4ee31..67cb11ed32 100644 --- a/src/tools/bfs_shell/Jamfile +++ b/src/tools/bfs_shell/Jamfile @@ -18,8 +18,15 @@ DEFINES += HAIKU_BUILD_COMPATIBILITY_H ; } defines = [ FDefines $(defines) ] ; + + local c++flags = ; + if $(HOST_GCC_VERSION[1]) >= 3 { + c++flags += -std=c++11 ; + } + SubDirCcFlags $(defines) -Wno-multichar ; SubDirC++Flags $(defines) -Wno-multichar -fno-rtti ; + SubDirC++Flags $(defines) $(c++flags) -Wno-multichar -fno-rtti ; } # platform specific libraries