Hi,
I have my environment variables set to German (LANG=de_DE.UTF-8), and
nevertheless the gcc compiler emits its warnings in English *if* invoked
by libtool.
Example (when compiling CLN-1.2.0):
$ /bin/sh ../libtool --mode=compile g++ -g -O2 -Wall -I../include -I../include
-I./base -c ./base/cl_as_exception.cc
g++ -g -O2 -Wall -I../include -I../include -I./base -c
./base/cl_as_exception.cc -fPIC -DPIC -o .libs/cl_as_exception.o
In file included from ./base/cl_N.h:6,
from ./base/cl_as_exception.cc:13:
../include/cln/number.h: In constructor 'cln::cl_number::cl_number(float)':
../include/cln/number.h:238: warning: type-punning to incomplete type might
break strict-aliasing rules
../include/cln/number.h: In member function 'cln::cl_number
cln::cl_number::operator=(float)':
../include/cln/number.h:238: warning: type-punning to incomplete type might
break strict-aliasing rules
../include/cln/number.h: In constructor 'cln::cl_number::cl_number(double)':
../include/cln/number.h:239: warning: type-punning to incomplete type might
break strict-aliasing rules
../include/cln/number.h: In member function 'cln::cl_number
cln::cl_number::operator=(double)':
../include/cln/number.h:239: warning: type-punning to incomplete type might
break strict-aliasing rules
g++ -g -O2 -Wall -I../include -I../include -I./base -c
./base/cl_as_exception.cc -o cl_as_exception.o /dev/null 21
But just copying the shown command into a shell prompt yields the warnings
in English:
$ g++ -g -O2 -Wall -I../include -I../include -I./base -c
./base/cl_as_exception.cc -fPIC -DPIC -o .libs/cl_as_exception.o
In file included from ./base/cl_N.h:6,
from ./base/cl_as_exception.cc:13:
../include/cln/number.h: In constructor »cln::cl_number::cl_number(float)«:
../include/cln/number.h:238: Warnung: Type-Punning auf unvollständigen Typen
kann strict-aliasing-Regeln verletzen
../include/cln/number.h: In member function »cln::cl_number
cln::cl_number::operator=(float)«:
../include/cln/number.h:238: Warnung: Type-Punning auf unvollständigen Typen
kann strict-aliasing-Regeln verletzen
../include/cln/number.h: In constructor »cln::cl_number::cl_number(double)«:
../include/cln/number.h:239: Warnung: Type-Punning auf unvollständigen Typen
kann strict-aliasing-Regeln verletzen
../include/cln/number.h: In member function »cln::cl_number
cln::cl_number::operator=(double)«:
../include/cln/number.h:239: Warnung: Type-Punning auf unvollständigen Typen
kann strict-aliasing-Regeln verletzen
Find attached a patch for it, relative to libtool-1.5.24 (tested),
and a tentative patch relative to the libtool CVS (untested).
Note that $ltenv can only be applied to commands that run a program, not to
shell builtins like eval ... or (cd ... ...).
Bruno
2008-01-20 Bruno Haible [EMAIL PROTECTED]
* ltmain.in (lt_env): New variable. Use it when running commands.
*** ltmain.in.bak 2007-06-24 03:30:51.0 +0200
--- ltmain.in 2008-01-20 17:11:15.0 +0100
***
*** 113,126
--- 113,131
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
+ lt_env=
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval if test \\${$lt_var+set}\ = set; then
save_$lt_var=\$$lt_var
+ lt_env=\$lt_var=\$$lt_var \$lt_env\
$lt_var=C
export $lt_var
fi
done
+ if test -n $lt_env; then
+ lt_env=env $lt_env
+ fi
# Make sure IFS has a sensible default
lt_nl='
***
*** 956,962
$run $rm $lobj $output_obj
$show $command
! if $run eval $command; then :
else
test -n $output_obj $run $rm $removelist
exit $EXIT_FAILURE
--- 961,967
$run $rm $lobj $output_obj
$show $command
! if $run eval $lt_env $command; then :
else
test -n $output_obj $run $rm $removelist
exit $EXIT_FAILURE
***
*** 1028,1034
command=$command$suppress_output
$run $rm $obj $output_obj
$show $command
! if $run eval $command; then :
else
$run $rm $removelist
exit $EXIT_FAILURE
--- 1033,1039
command=$command$suppress_output
$run $rm $obj $output_obj
$show $command
! if $run eval $lt_env $command; then :
else
$run $rm $removelist
exit $EXIT_FAILURE
2008-01-20 Bruno Haible [EMAIL PROTECTED]
* libltdl/config/ltmain.m4sh (lt_env): New variable.
* libltdl/config/general.m4sh (func_show_eval): Use it.
*** libltdl/config/ltmain.m4sh.bak 2008-01-20 17:08:53.0 +0100
--- libltdl/config/ltmain.m4sh 2008-01-20 17:13:06.0 +0100
***
*** 96,109
--- 96,114
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
+ lt_env=
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE