From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 27 12:08:01 2022 Received: (at submit) by debbugs.gnu.org; 27 Jul 2022 16:08:01 +0000 Received: from localhost ([127.0.0.1]:56845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGjZp-0000Kr-5H for submit@debbugs.gnu.org; Wed, 27 Jul 2022 12:08:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:55124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGjZj-0000Ke-Jm for submit@debbugs.gnu.org; Wed, 27 Jul 2022 12:07:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGjZj-0005GB-7o; Wed, 27 Jul 2022 12:07:55 -0400 Received: from a3.inai.de ([2a01:4f8:10b:45d8::f5]:35090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGjZe-0003Vz-UM; Wed, 27 Jul 2022 12:07:54 -0400 Received: by a3.inai.de (Postfix, from userid 25121) id 746C15872FA47; Wed, 27 Jul 2022 18:07:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by a3.inai.de (Postfix) with ESMTP id 723A260C01690; Wed, 27 Jul 2022 18:07:44 +0200 (CEST) Date: Wed, 27 Jul 2022 18:07:44 +0200 (CEST) From: Jan Engelhardt To: bug-libtool@gnu.org Subject: Inconsistent locale settings between LT and non-LT $CC invocation Message-ID: User-Agent: Alpine 2.25 (LSU 592 2021-09-18) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Received-SPF: pass client-ip=2a01:4f8:10b:45d8::f5; envelope-from=jengelh@inai.de; helo=a3.inai.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: bug-automake@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Greetings. This is a bug report primarily against libtool 2.4.7. automake is Cc'ed. libtool seems to reset locales, causing compiler output to differ between libtool-based invocations and those without libtool. This becomes in particular visible when an automake project invokes both compile strategies. Observed ======== $ make V=0 CXX foo.o foo.cpp: In function ‘int main()’: foo.cpp:1:36: warning: declaration of ‘foo’ shadows a previous local [-Wshadow] 1 | int main() { auto foo = 42; { auto foo = 43; }} CXXLD foo CXX bar.lo bar.cpp: In function 'int main()': bar.cpp:1:36: warning: declaration of 'foo' shadows a previous local [-Wshadow] 1 | int main() { auto foo = 42; { auto foo = 43; }} Expected to see =============== Do not mix '' and ‘’. Stick to one variant. Either libtool should stop resetting the locale, or perhaps automake should start resetting the locale. Testcase ======== foo.cpp ------- int main() { auto foo = 42; { auto foo = 43; }} Makefile.am ----------- BUILT_SOURCES = bar.cpp bar.cpp: foo.cpp cp foo.cpp bar.cpp AM_CXXFLAGS = -Wshadow bin_PROGRAMS = foo foo_SOURCES = foo.cpp lib_LTLIBRARIES = libbar.la libbar_la_SOURCES = bar.cpp configure.ac ------------ AC_INIT([blah], [0]) AM_INIT_AUTOMAKE([1.10 foreign subdir-objects]) LT_INIT([disable-static]) AC_PROG_CXX AC_CONFIG_FILES([Makefile]) AC_OUTPUT