From 4e9206f48c91e17f43856b016b12f59dd5118293 Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Tue, 2 Mar 2021 13:55:07 -0800 Subject: [PATCH] Make returning a local reference a compilation error (#25568) * Make returning a local reference a compile error * Bazel doesn't like return-local-addr --- tools/bazel.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bazel.rc b/tools/bazel.rc index 8948e91b27b..0797658ecb9 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -9,6 +9,7 @@ build:opt --compilation_mode=opt build:opt --copt=-Wframe-larger-than=16384 build:dbg --compilation_mode=dbg +build:dbg --copt=-Werror=return-stack-address build:windows_opt --compilation_mode=opt build:windows_dbg --compilation_mode=dbg