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]

[v3] compliant headers, shared links for testsuites



now using the alloca hack to get around __extension__ not working.

this turns on fully compliant headers, increasing compile times but
making strict standard-conformance more of a priority.

x86/linux

-benjamin

2001-02-22  Benjamin Kosnik  <bkoz@redhat.com>

	* tests_flags.in (CXXFLAGS): Add -rpath to gcc build dir.

	* include/bits/ostream.tcc: Same.
	* include/bits/std_ostream.h: Same.
	* include/bits/fstream.tcc: Same.
	* include/bits/codecvt.h: Use alloca.
	* include/bits/locale_facets.tcc: Add typename.
	* include/bits/c++config (_GLIBCPP_FULLY_COMPLIANT_HEADERS): Enable.

Index: tests_flags.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/tests_flags.in,v
retrieving revision 1.11
diff -c -p -r1.11 tests_flags.in
*** tests_flags.in	2001/02/21 21:58:20	1.11
--- tests_flags.in	2001/02/23 07:08:53
***************
*** 23,30 ****
  #      needed to run library specific tests,
  #      BUILD_DIR:SRC_DIR:PREFIX_DIR:CXX:CXXFLAGS:INCLUDES:LIBS 
  #      the meaning of which is as follows:
! #        BUILD_DIR   build-dir
! #        SRC_DIR     src-dir
  #        PREFIX_DIR  install-dir (meaningful only with --installed-library)
  #        CXX         which C++ compiler is being used
  #        CXXFLAGS    special flags to pass to g++
--- 23,30 ----
  #      needed to run library specific tests,
  #      BUILD_DIR:SRC_DIR:PREFIX_DIR:CXX:CXXFLAGS:INCLUDES:LIBS 
  #      the meaning of which is as follows:
! #        BUILD_DIR   libstdc++-v3 build-dir
! #        SRC_DIR     libstdc++-v3 src-dir
  #        PREFIX_DIR  install-dir (meaningful only with --installed-library)
  #        CXX         which C++ compiler is being used
  #        CXXFLAGS    special flags to pass to g++
*************** esac
*** 122,132 ****
  # For built or installed libraries, we need to get right OS-specific bits.
  . ${SRC_DIR}/configure.target
  
! # LIB_PATH == where to find the build libraries for libtool's use
  # CXX == the full pathname of the compiler
  case ${query} in
      --built-library)
      LIB_PATH=${BUILD_DIR}/src
      CXX="${BUILD_DIR}/../../gcc/g++"
      ;;
      --installed-library)
--- 122,134 ----
  # For built or installed libraries, we need to get right OS-specific bits.
  . ${SRC_DIR}/configure.target
  
! # LIB_PATH == where to find the C++ build libraries for libtool's use
! # GCC_LIB_PATH == where to find the gcc build libraries for libtool's use
  # CXX == the full pathname of the compiler
  case ${query} in
      --built-library)
      LIB_PATH=${BUILD_DIR}/src
+     GCC_LIB_PATH=${BUILD_DIR}/../../gcc
      CXX="${BUILD_DIR}/../../gcc/g++"
      ;;
      --installed-library)
*************** CXXFLAGS="-ggdb3 -DDEBUG_ASSERT @SECTION
*** 143,149 ****
  case ${query} in
      --built-library)
      LIBS="${LIB_PATH}/../libsupc++/libsupc++.la ${LIB_PATH}/libstdc++.la
! 	    -no-install"
      case @target_os@ in
          *cygwin*)  LIBS="${LIBS} -nodefaultlibs -lgcc -lcygwin -luser32
                           -lkernel32 -ladvapi32 -lshell32" ;;
--- 145,151 ----
  case ${query} in
      --built-library)
      LIBS="${LIB_PATH}/../libsupc++/libsupc++.la ${LIB_PATH}/libstdc++.la
! 	    -no-install -rpath ${GCC_LIB_PATH}"
      case @target_os@ in
          *cygwin*)  LIBS="${LIBS} -nodefaultlibs -lgcc -lcygwin -luser32
                           -lkernel32 -ladvapi32 -lshell32" ;;
Index: include/bits/c++config
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/c++config,v
retrieving revision 1.12
diff -c -p -r1.12 c++config
*** c++config	2001/02/20 20:20:47	1.12
--- c++config	2001/02/23 07:08:54
***************
*** 47,53 ****
  // types. For the io library, this means that larger, out-of-line
  // member functions are only declared, and definitions are not parsed
  // by the compiler, but instead instantiated into the library binary.
! // #define _GLIBCPP_FULLY_COMPLIANT_HEADERS 1
  
  // To enable older, ARM-style iostreams and other anachronisms use this.
  //#define _GLIBCPP_DEPRECATED 1
--- 47,53 ----
  // types. For the io library, this means that larger, out-of-line
  // member functions are only declared, and definitions are not parsed
  // by the compiler, but instead instantiated into the library binary.
! #define _GLIBCPP_FULLY_COMPLIANT_HEADERS 1
  
  // To enable older, ARM-style iostreams and other anachronisms use this.
  //#define _GLIBCPP_DEPRECATED 1
Index: include/bits/codecvt.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/codecvt.h,v
retrieving revision 1.11
diff -c -p -r1.11 codecvt.h
*** codecvt.h	2001/02/19 18:52:24	1.11
--- codecvt.h	2001/02/23 07:08:56
***************
*** 419,425 ****
  	  if (__int_bom)
  	    {	  
  	      size_t __size = __from_end - __from;
! 	      __extension__ intern_type __cfixed[__size + 1];
  	      __cfixed[0] = static_cast<intern_type>(__int_bom);
  	      char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
--- 419,425 ----
  	  if (__int_bom)
  	    {	  
  	      size_t __size = __from_end - __from;
! 	      intern_type* __cfixed = static_cast<intern_type*>(alloca(sizeof(intern_type) * (__size + 1)));
  	      __cfixed[0] = static_cast<intern_type>(__int_bom);
  	      char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
***************
*** 524,530 ****
  	  if (__ext_bom)
  	    {	  
  	      size_t __size = __from_end - __from;
! 	      __extension__ extern_type __cfixed[__size + 1];
  	      __cfixed[0] = static_cast<extern_type>(__ext_bom);
  	      char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
--- 524,530 ----
  	  if (__ext_bom)
  	    {	  
  	      size_t __size = __from_end - __from;
! 	      extern_type* __cfixed = (sizeof(extern_type) * (__size + 1));
  	      __cfixed[0] = static_cast<extern_type>(__ext_bom);
  	      char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
Index: include/bits/fstream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/fstream.tcc,v
retrieving revision 1.6
diff -c -p -r1.6 fstream.tcc
*** fstream.tcc	2001/02/17 17:51:45	1.6
--- fstream.tcc	2001/02/23 07:08:57
*************** namespace std
*** 262,268 ****
  	      // Part one: (Re)fill external buf (_M_file->_IO_*) from
  	      // external byte sequence (whatever physical byte sink or
  	      // FILE actually is.)
! 	      __extension__ char_type __conv_buf[_M_buf_size];
  	      streamsize __size = _M_file->xsgetn(__conv_buf, _M_buf_size);
  	      
  	      // Part two: (Re)fill internal buf contents from external buf.
--- 262,268 ----
  	      // Part one: (Re)fill external buf (_M_file->_IO_*) from
  	      // external byte sequence (whatever physical byte sink or
  	      // FILE actually is.)
! 	      char_type* __conv_buf = static_cast<char_type*>(alloca(sizeof(char_type) * _M_buf_size));
  	      streamsize __size = _M_file->xsgetn(__conv_buf, _M_buf_size);
  	      
  	      // Part two: (Re)fill internal buf contents from external buf.
*************** namespace std
*** 436,442 ****
  	  // stack. Convert internal buffer plus __c (ie,
  	  // "pending sequence") to temporary conversion buffer.
  	  int __plen = _M_out_end - _M_out_beg;
! 	  __extension__ char_type __pbuf[__plen + 1];	      
  	  traits_type::copy(__pbuf, this->pbase(), __plen);
  	  if (!__testeof)
  	    {
--- 436,442 ----
  	  // stack. Convert internal buffer plus __c (ie,
  	  // "pending sequence") to temporary conversion buffer.
  	  int __plen = _M_out_end - _M_out_beg;
! 	  char_type* __pbuf = static_cast<char_type*>(alloca(sizeof(char_type) * __plen + 1));
  	  traits_type::copy(__pbuf, this->pbase(), __plen);
  	  if (!__testeof)
  	    {
*************** namespace std
*** 445,451 ****
  	    }
  
  	  char_type* __pend;
! 	  __extension__ char __conv_buf[__plen];
  	  char* __conv_end;
  	  _M_state_beg = _M_state_cur;
  
--- 445,451 ----
  	    }
  
  	  char_type* __pend;
! 	  char* __conv_buf = static_cast<char*>(alloca(__plen));
  	  char* __conv_end;
  	  _M_state_beg = _M_state_cur;
  
Index: include/bits/locale_facets.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.9
diff -c -p -r1.9 locale_facets.tcc
*** locale_facets.tcc	2001/02/16 00:42:20	1.9
--- locale_facets.tcc	2001/02/23 07:09:00
*************** namespace std
*** 722,729 ****
  
    template <typename _CharT, typename _RaIter>
      _RaIter
!     __pad(_RaIter __s, _CharT __fill, int __padding,
!             random_access_iterator_tag)
      {
        fill_n(__s, __fill);
        return __s + __padding;
--- 722,729 ----
  
    template <typename _CharT, typename _RaIter>
      _RaIter
!     __pad(_RaIter __s, _CharT __fill, int __padding, 
! 	  random_access_iterator_tag)
      {
        fill_n(__s, __fill);
        return __s + __padding;
*************** namespace std
*** 741,748 ****
      inline _OutIter
      __pad(_OutIter __s, _CharT __fill, int __padding)
      {
!       return __pad(__s, __fill, __padding,
!                      iterator_traits<_OutIter>::iterator_category());
      }
  
    template <typename _CharT, typename _OutIter>
--- 741,748 ----
      inline _OutIter
      __pad(_OutIter __s, _CharT __fill, int __padding)
      {
!       return __pad(__s, __fill, __padding, 
! 		   typename iterator_traits<_OutIter>::iterator_category());
      }
  
    template <typename _CharT, typename _OutIter>
Index: include/bits/ostream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/ostream.tcc,v
retrieving revision 1.5
diff -c -p -r1.5 ostream.tcc
*** ostream.tcc	2001/02/17 17:51:45	1.5
--- ostream.tcc	2001/02/23 07:09:02
*************** namespace std {
*** 417,423 ****
        typedef typename traits_type::int_type int_type;
        
        int_type __plen = static_cast<size_t>(__newlen - __oldlen); 
!       __extension__ char_type __pads[__plen];
        traits_type::assign(__pads, __plen, __ios.fill()); 
  
        char_type* __beg;
--- 417,423 ----
        typedef typename traits_type::int_type int_type;
        
        int_type __plen = static_cast<size_t>(__newlen - __oldlen); 
!       char_type* __pads = static_cast<char_type*>(alloca(sizeof(char_type) * __plen));
        traits_type::assign(__pads, __plen, __ios.fill()); 
  
        char_type* __beg;
*************** namespace std {
*** 496,502 ****
  	{
  	  try {
  	    streamsize __w = __out.width();
! 	    __extension__ _CharT __pads[__w];
  	    __pads[0] = __c;
  	    streamsize __len = 1;
  	    if (__w > __len)
--- 496,502 ----
  	{
  	  try {
  	    streamsize __w = __out.width();
! 	    _CharT* __pads = static_cast<_CharT*>(alloca(sizeof(_CharT) * __w));
  	    __pads[0] = __c;
  	    streamsize __len = 1;
  	    if (__w > __len)
*************** namespace std {
*** 529,535 ****
  	{
  	  try {
  	    streamsize __w = __out.width();
! 	    __extension__ char __pads[__w + 1];
  	    __pads[0] = __c;
  	    streamsize __len = 1;
  	    if (__w > __len)
--- 529,535 ----
  	{
  	  try {
  	    streamsize __w = __out.width();
! 	    char* __pads = static_cast<char*>(alloca(__w + 1));
  	    __pads[0] = __c;
  	    streamsize __len = 1;
  	    if (__w > __len)
*************** namespace std {
*** 596,602 ****
        if (__cerb)
  	{
  	  size_t __clen = __ctraits_type::length(__s);
! 	  __extension__ _CharT __ws[__clen + 1];
  	  for (size_t  __i = 0; __i <= __clen; ++__i)
  	    __ws[__i] = __out.widen(__s[__i]);
  	  _CharT* __str = __ws;
--- 596,602 ----
        if (__cerb)
  	{
  	  size_t __clen = __ctraits_type::length(__s);
! 	  _CharT* __ws = static_cast<_CharT*>(alloca(sizeof(_CharT) * (__clen + 1)));
  	  for (size_t  __i = 0; __i <= __clen; ++__i)
  	    __ws[__i] = __out.widen(__s[__i]);
  	  _CharT* __str = __ws;
*************** namespace std {
*** 604,610 ****
  	  try {
  	    streamsize __len = static_cast<streamsize>(__clen);
  	    streamsize __w = __out.width();
! 	    __extension__ _CharT __pads[__w];
  
  	    if (__w > __len)
  	      {
--- 604,610 ----
  	  try {
  	    streamsize __len = static_cast<streamsize>(__clen);
  	    streamsize __w = __out.width();
! 	    _CharT* __pads = static_cast<_CharT*>(alloca(sizeof(_CharT) * __w));
  
  	    if (__w > __len)
  	      {
*************** namespace std {
*** 637,643 ****
  	{
  	  try {
  	    streamsize __w = __out.width();
! 	    __extension__ char __pads[__w];
  	    streamsize __len = static_cast<streamsize>(_Traits::length(__s));
  	    if (__w > __len)
  	      {
--- 637,643 ----
  	{
  	  try {
  	    streamsize __w = __out.width();
! 	    char* __pads = static_cast<char*>(alloca(__w));
  	    streamsize __len = static_cast<streamsize>(_Traits::length(__s));
  	    if (__w > __len)
  	      {
Index: include/bits/std_ostream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_ostream.h,v
retrieving revision 1.3
diff -c -p -r1.3 std_ostream.h
*** std_ostream.h	2001/02/19 18:52:25	1.3
--- std_ostream.h	2001/02/23 07:09:03
*************** namespace std {
*** 281,290 ****
  #endif
  
  #endif	/* _CPP_OSTREAM */
- 
- 
- 
- 
- 
- 
- 
--- 281,283 ----


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