www.digitalmars.com         C & C++   DMDScript  

c++.wxwindows - 8.37 beta failure

reply chris elliott <biol75 york.ac.uk> writes:
wxwindows (2.4.2) was Ok with 8.36

C:\wx\wxWindows-2.4.2\src\msw>scppn
Digital Mars C/C++ Compiler Version 8.36.4n
Copyright (C) Digital Mars 2000-2003.  All Rights Reserved.
Written by Walter Bright
www.digitalmars.com

Now dies with latest beta

dmc -c -cpp -Ae -Ar -mn -D_WINDOWS -6 -a8 -Nc -c -H -HD..\..\d_mars -HO- 
-DWXMSW
  -D__WIN32__ -D__WIN95__ -D__WXDEBUG__  -I..\..\include -I..\..\lib\_sc 
-I..\..\
contrib\include 
-I..\../src/regex;..\../src/png;..\../src/jpeg;..\../src/zlib;..
\../src/tiff  ..\..\src\common\variant.cpp -o..\..\src\common\variant.obj
         wxVariant variant( wxString( (wxChar*) 
(data->GetValue().Nth(idx)->Data(
)) ));
                                                    ^
..\..\src\common\variant.cpp(1866) : Error: ')' expected
         return variant;
              ^
..\..\src\common\variant.cpp(1867) : Error: '=', ';' or ',' expected
     }
     ^
..\..\src\common\variant.cpp(1868) : Error: '=', ';' or ',' expected
}
^
..\..\src\common\variant.cpp(1870) : Error: '=', ';' or ',' expected
     wxVariantDataList* data = (wxVariantDataList*) m_data;
                             ^
..\..\src\common\variant.cpp(1879) : Error: 'data' is not in function 
parameter
list
Fatal error: too many errors
--- errorlevel 1

--- errorlevel 1

code here reads:

wxVariant wxVariant::operator[] (size_t idx) const
{
     wxASSERT_MSG( (GetType() == wxT("list") || GetType() == 
wxT("stringlist")), wxT("Invalid type for array operator") );

     if (GetType() == wxT("list"))
     {
         wxVariantDataList* data = (wxVariantDataList*) m_data;
         wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), 
wxT("Invalid index for array") );
         return * (wxVariant*) (data->GetValue().Nth(idx)->Data());
     }
     else if (GetType() == wxT("stringlist"))
     {
         wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
         wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), 
wxT("Invalid index for array") );

         wxVariant variant( wxString( (wxChar*) 
(data->GetValue().Nth(idx)->Data()) ));
         return variant;
     }
     return wxNullVariant;
}

dmc version now:
C:\wx\wxWindows-2.4.2\src\msw>scppn
Digital Mars C/C++ Compiler Version 8.37.3n
Copyright (C) Digital Mars 2000-2003.  All Rights Reserved.
Written by Walter Bright
www.digitalmars.com


chris
Sep 30 2003
next sibling parent "Walter" <walter digitalmars.com> writes:
Can you please try and cut it down to a small example? Also, you don't need
the -mn, -6, or -a8 flags as they are the default.
Sep 30 2003
prev sibling parent Arjan Knepper <arjan ask.me> writes:
Workaround:
replace/change the variant.cpp line 1866:
// wxVariant variant( wxString( (wxChar*) ( data -> GetValue ().Nth ( 
idx ) -> Data () ) ) );

with/to:
wxVariant   variant ( (const wxString &) wxString ( (wxChar *) data -> 
GetValue ().Nth ( idx ) -> Data () ) );

Arjan

chris elliott wrote:
 
 
 wxwindows (2.4.2) was Ok with 8.36
 
 C:\wx\wxWindows-2.4.2\src\msw>scppn
 Digital Mars C/C++ Compiler Version 8.36.4n
 Copyright (C) Digital Mars 2000-2003.  All Rights Reserved.
 Written by Walter Bright
 www.digitalmars.com
 
 Now dies with latest beta
 
 dmc -c -cpp -Ae -Ar -mn -D_WINDOWS -6 -a8 -Nc -c -H -HD..\..\d_mars -HO- 
 -DWXMSW
  -D__WIN32__ -D__WIN95__ -D__WXDEBUG__  -I..\..\include -I..\..\lib\_sc 
 -I..\..\
 contrib\include 
 -I..\../src/regex;..\../src/png;..\../src/jpeg;..\../src/zlib;..
 \../src/tiff  ..\..\src\common\variant.cpp -o..\..\src\common\variant.obj
         wxVariant variant( wxString( (wxChar*) 
 (data->GetValue().Nth(idx)->Data(
 )) ));
                                                    ^
 ..\..\src\common\variant.cpp(1866) : Error: ')' expected
         return variant;
              ^
 ..\..\src\common\variant.cpp(1867) : Error: '=', ';' or ',' expected
     }
     ^
 ..\..\src\common\variant.cpp(1868) : Error: '=', ';' or ',' expected
 }
 ^
 ..\..\src\common\variant.cpp(1870) : Error: '=', ';' or ',' expected
     wxVariantDataList* data = (wxVariantDataList*) m_data;
                             ^
 ..\..\src\common\variant.cpp(1879) : Error: 'data' is not in function 
 parameter
 list
 Fatal error: too many errors
 --- errorlevel 1
 
 --- errorlevel 1
 
 code here reads:
 
 wxVariant wxVariant::operator[] (size_t idx) const
 {
     wxASSERT_MSG( (GetType() == wxT("list") || GetType() == 
 wxT("stringlist")), wxT("Invalid type for array operator") );
 
     if (GetType() == wxT("list"))
     {
         wxVariantDataList* data = (wxVariantDataList*) m_data;
         wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), 
 wxT("Invalid index for array") );
         return * (wxVariant*) (data->GetValue().Nth(idx)->Data());
     }
     else if (GetType() == wxT("stringlist"))
     {
         wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
         wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), 
 wxT("Invalid index for array") );
 
         wxVariant variant( wxString( (wxChar*) 
 (data->GetValue().Nth(idx)->Data()) ));
         return variant;
     }
     return wxNullVariant;
 }
 
 dmc version now:
 C:\wx\wxWindows-2.4.2\src\msw>scppn
 Digital Mars C/C++ Compiler Version 8.37.3n
 Copyright (C) Digital Mars 2000-2003.  All Rights Reserved.
 Written by Walter Bright
 www.digitalmars.com
 
 
 chris
 

Oct 05 2003