Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Vivian Meazza
Alan Teeder wrote From this morning´s CVS I now get this with VC++ 2008 :- -- Build started: Project: FlightGear, Configuration: Release Win32 -- Compiling... WaypointList.cxx ..\..\..\src\GUI\WaypointList.cxx(112) : error C2057: expected constant expression

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Vivian Meazza
Vivian Meazza wrote Alan Teeder wrote From this morning´s CVS I now get this with VC++ 2008 :- -- Build started: Project: FlightGear, Configuration: Release Win32 -- Compiling... WaypointList.cxx ..\..\..\src\GUI\WaypointList.cxx(112) : error C2057: expected constant

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Frederic Bouvier
Hi Vivian, - Vivian Meazza a écrit : Vivian Meazza wrote Alan Teeder wrote From this morning´s CVS I now get this with VC++ 2008 :- -- Build started: Project: FlightGear, Configuration: Release Win32 -- Compiling... WaypointList.cxx

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread James Turner
On 22 Feb 2010, at 17:37, Frederic Bouvier wrote: This should be : int len = strlen(s); char *buf = new char[len]; ... delete buf; Urk I'm confused - I thought this was a C99 feature, is it a GNU extension? Regards, James

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Frederic Bouvier
- James Turner a écrit : On 22 Feb 2010, at 17:37, Frederic Bouvier wrote: This should be : int len = strlen(s); char *buf = new char[len]; ... delete buf; Urk I'm confused - I thought this was a C99 feature, is it a GNU extension? Yes, I am afraid. This

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread James Turner
On 22 Feb 2010, at 18:29, Frederic Bouvier wrote: Yes, I am afraid. This code construction show up in the code from time to time and we have to provide a replacement. I think the best approach is to use an auto_ptr. std::auto_ptrchar buf( new char[len] ); in order to be exception safe.

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Manuel Massing
Hi Frederic, Yes, I am afraid. This code construction show up in the code from time to time and we have to provide a replacement. I think the best approach is to use an auto_ptr. std::auto_ptrchar buf( new char[len] ); in order to be exception safe. For array allocations, you need to

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Tim Moore
On Mon, Feb 22, 2010 at 7:45 PM, Manuel Massing m.mass...@warped-space.dewrote: Hi Frederic, Yes, I am afraid. This code construction show up in the code from time to time and we have to provide a replacement. I think the best approach is to use an auto_ptr. std::auto_ptrchar buf(

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Frederic Bouvier
Hi Manuel, - Manuel Massing a écrit : Hi Frederic, Yes, I am afraid. This code construction show up in the code from time to time and we have to provide a replacement. I think the best approach is to use an auto_ptr. std::auto_ptrchar buf( new char[len] ); in order to

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Manuel Massing
The last time I went down this path, I ended up back at good ole std::vector. In this context, std::string would be just fine too. second that :-) Manuel -- Download Intel#174; Parallel Studio Eval Try the new

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Brant Gipson
This file fails to compile even on Linux with g++. I just commented out the problematic line as a quick fix so FG will compile. On Mon, Feb 22, 2010 at 3:03 PM, Manuel Massing m.mass...@warped-space.de wrote: The last time I went down this path, I ended up back at good ole std::vector. In this

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Manuel Massing
Hi Fred, In theroy, you are correct, but as long as char doesn't have a destructor, this is totally overkill, and not very efficient. If the type has no destructor, it won't be called, so the efficiency argument is moot. But the real issue is that calling delete on an array has undefined

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread James Turner
On 22 Feb 2010, at 20:13, Brant Gipson wrote: This file fails to compile even on Linux with g++. I just commented out the problematic line as a quick fix so FG will compile. That is *very* odd : I build (when I remember) with Ubuntu 9.10 here and everything works - can you be more specific

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Csaba Halász
On Mon, Feb 22, 2010 at 7:23 PM, James Turner zakal...@mac.com wrote: Urk I'm confused - I thought this was a C99 feature, is it a GNU extension? AFAIK it *is* a C99 feature, but not a standard C++ feature (yet). -- Csaba/Jester

Re: [Flightgear-devel] VC90 compile fail in WaypointList.cxx

2010-02-22 Thread Brant Gipson
I'm building on ubuntu 9.10 64 bit with brisa's compile script. This is my g++ version: g++ -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs