This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Make vector::at() assertion message more useful (try #2)


Hi,

thanks Andreas.

On 9/23/13 3:53 AM, Andreas Schwab wrote:
Paul Pluzhnikov<ppluzhnikov@google.com>  writes:

Index: libstdc++-v3/src/c++11/snprintf_lite.cc
===================================================================
--- libstdc++-v3/src/c++11/snprintf_lite.cc	(revision 0)
+++ libstdc++-v3/src/c++11/snprintf_lite.cc	(revision 0)
@@ -0,0 +1,152 @@
+// Debugging support -*- C++ -*-
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+//<http://www.gnu.org/licenses/>.
+
+#include<stdarg.h>
+#include<bits/functexcept.h>
+#include<bits/locale_facets.h>
+
+namespace std {
+  template<typename _CharT, typename _ValueT>
+  int
+  __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
+                ios_base::fmtflags __flags, bool __dec);
+}
+
m68k-linux/./libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `int std::__int_to_char<char, unsigned int>(char*, unsigned int, char const*, std::_Ios_Fmtflags, bool)'
Paul, the *.cc are built with implicit instantiations disabled and we are missing explicit instantiations of this function template. If I remember correctly, we normally instantiate it in locale-inst.cc only for unsigned long and unsigned long long as second template argument. Thus, I would say, either make sure to use only those two in the new code, or add explicit instantiations. I would rather prefer the former, for example casting __val to (unsigned long long) in __concat_size_t isn't particularly elegant (vs for example checking if size_t isn't either unsigned long neither unsigned long long and adding an explicit instantiation only in that case) but would work I think. In any case, if it works for Andreas he is also preapproved to commit this kind change to unbreak his target.

Paolo.


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