← Back to team overview

kicad-developers team mailing list archive

Re: I really *love* STL error messages

 

On Mon, Mar 26, 2012 at 03:00:55PM -0500, Dick Hollenbeck wrote:
> Enabling USE_NEW_PCBNEW_SAVE will likely cause an addition compilation failure on your system.

Funny think... it compiles fine the 'const char' issue but then chokes
on kicad-plugin (these are only warnings):

/home/mrclnz/cvswork/kicad-bzr/pcbnew/kicad_plugin.cpp: In member function ‘void KICAD_PLUGIN::loadPCB_TEXT()’:
/home/mrclnz/cvswork/kicad-bzr/pcbnew/kicad_plugin.cpp:1766:50: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [enabled by default]
/usr/include/wx-2.8/wx/string.h:1422:10: note: candidate 1: wxString operator+(const wxString&, wxChar)
/home/mrclnz/cvswork/kicad-bzr/pcbnew/kicad_plugin.cpp:1766:50: note: candidate 2: operator+(const wxChar* {aka const wchar_t*}, int) <built-in>
/home/mrclnz/cvswork/kicad-bzr/pcbnew/kicad_plugin.cpp: In member function ‘virtual void KICAD_PLUGIN::Save(const wxString&, BOARD*, PROPERTIES*)’:
/home/mrclnz/cvswork/kicad-bzr/pcbnew/kicad_plugin.cpp:2710:46: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

My opinion is that 4.6 became stricter on C++ issues and then some
'marginal' code wouldn't pass unnoticed (it seems that string constness
is very liable to give these warnings/errors).

Logically an hashtable key should be const (otherwise it could be
changed without rehashing!), but if it doesn't compile for you, that's
another problem. OTOH 4.6 can be coaxed to ignore the issue with
-fpermissive, so I don't see any other problem (for *now*).

The real issue is that the type system for C++ became too complicated,
IMHO.

> In two years I would go a different way.  But, "letting wx do the work" means letting them do the work by using a sufficiently new version relative to your compiler.

I'd simply have used an std::map, or the hash table in TR1 (which seems
to be somewhat diffused) or boost::unordered_map (since we already use
boost)... I think these are *more* standard than any wx invention :P

Anyway at the end the build seems fine for me...

-- 
Lorenzo Marcantonio
Logos Srl


Follow ups

References