This is the mail archive of the gcc@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]

egcs / g++ conflicts c++ draft standard (i think)


	Could please  someone tell me where can  i find  a list of non
standard c++ features  supported by g++.  Following are this 2 samples
discovered  because we have to port  to  WinNT and VC++5 don't compile
this code. 

-- Initialization of const data member inside class definition
//conflicts Stroustrup: C++ Programming Language 3ed - 10.4.6.2
class foo
{
....
  const int qtd = 100;
....
};
-- end

-- Dynamic allocation of array bounds (no const bounds)
//conflicts Stroustrup: C++ Programming Language 3ed - 5.2
#include <stdio.h>
#include <stdlib.h>

int main (int argc, char** argv)
{
  int size;

  if(argc > 1)
    size = atoi(argv[1]);
  else
    size = 100;

  int dynarray[size];
  for(int j=0; j<size; ++j)
    dynarray[j] = j;

  printf("last array element %d\n", dynarray[size-1]);

  return 0;
}
-- end

	This 2 samples compile and work without a warning with g++
2.7.2.1 and egcs on Linux with libc5 and glibc2.


	Thanks in advance
	Frederico Neves

-- 
 ----------------------------------------------------------------
 Frederico A. C. Neves         ExCon Consultoria em Sistemas Ltda
 <fneves@ExCon.com.BR>                  R.Maestro Cardim 560 - 25
 Tel/Fax +55-11-253-0043      Sao Paulo - SP - Brazil - 01323-000 


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