This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problems in locale-facets.tcc -- can we disable -Wformat?


Since the library is built with `-Wformat' (implied by `-Wall')
and `-Werror', the build fails in `locale_facets.tcc', as it
passes non-literal strings to C formating functions.

In my opinion it is resonable to exclude `-Werror', since this
disables an actual feature.  If you agree, there is a patch below.


1999-11-23  Petter Urkedal  <petter@matfys.lth.se>

	* src/Makefile.am (CXXFLAGS): Add -Wno-format to allow non-
	string literals in format, as used in locale-facets.tcc.


A clip from the compilation:

c++ -DHAVE_CONFIG_H -I. -I../../libstdc++/src -I.. -nostdinc++
-I../../libstdc++ -I../../libstdc++/stl -I../../libstdc++/libio -g
-D_GNU_SOURCE -fno-implicit-templates -Wall -W -Wwrite-strings -Winline
-Werror -fimplicit-templates -c  -fPIC -DPIC
../../libstdc++/src/locale-inst.cc -o .libs/locale-inst.lo
cc1plus: warnings being treated as errors
../../libstdc++/bits/locale_facets.tcc: In method `_OutIter
num_put<_CharT, _OutIter>::do_put (_OutIter, ios_base &, _CharT, double)
const [with _CharT = char, _OutIter = ostreambuf_iterator<char,
char_traits<char> >]':
../../libstdc++/bits/locale_facets.h:1108:   instantiated from
`num_put<_CharT, _OutIter>::put (_OutIter, ios_base &, _CharT, double)
const [with _CharT = char, _OutIter = ostreambuf_iterator<char,
char_traits<char> >]'
../../libstdc++/src/locale-inst.cc:82:   instantiated from here
../../libstdc++/bits/locale_facets.tcc:1122: warning: format not a
string literal, argument types not checked
../../libstdc++/bits/locale_facets.tcc:1124: warning: format not a
string literal, argument types not checked
[more warnings]


Index: src/Makefile.am
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/Makefile.am,v
retrieving revision 1.56
diff -c -r1.56 Makefile.am
*** Makefile.am 1999/11/09 18:31:09     1.56
--- Makefile.am 1999/11/23 12:04:27
***************
*** 8,14 ****
  WERROR = -Werror
  # OTHER_CXXFLAGS = -fsquangle -fhonor-std -fnew-exceptions
  CXXFLAGS = -g -D_GNU_SOURCE -fno-implicit-templates \
!          -Wall -W -Wwrite-strings -Winline $(WERROR) $(OTHER_CXXFLAGS)
  
  CXXLINK = $(LIBTOOL) --mode=link $(CC) $(AM_CXXFLAGS) $(CXXFLAGS)
$(LDFLAGS) -o $@
  
--- 8,15 ----
  WERROR = -Werror
  # OTHER_CXXFLAGS = -fsquangle -fhonor-std -fnew-exceptions
  CXXFLAGS = -g -D_GNU_SOURCE -fno-implicit-templates \
!          -Wall -Wno-format -W -Wwrite-strings -Winline $(WERROR) \
!          $(OTHER_CXXFLAGS)
  
  CXXLINK = $(LIBTOOL) --mode=link $(CC) $(AM_CXXFLAGS) $(CXXFLAGS)
$(LDFLAGS) -o $@

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]