bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56798: Inconsistent locale settings between LT and non-LT $CC invoca


From: Jan Engelhardt
Subject: bug#56798: Inconsistent locale settings between LT and non-LT $CC invocation
Date: Wed, 27 Jul 2022 18:07:44 +0200 (CEST)
User-agent: Alpine 2.25 (LSU 592 2021-09-18)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]