[gecode-users] msvc 8.0 SP1 warning C4251

Christian Schulte cschulte at kth.se
Mon Aug 27 10:44:52 CEST 2007


Dear Filip,

these warnings you only get when using -Wall, right? So with normal defaults
you should not get any warnings. If you want to switch them off, use
-wd4251. I am rather reluctant to add the pragmas as this clutters the code.

As it comes to Pimpl, I am not convinced that this is really an issue for
us. Our interfaces can change, that's okay. Why pay for a level of
indirection then. BTW: it used to be Pimpl before.

The problem with DLL linkage in general is that you can't get it warning
free for all compilers on Windows... 

Cheers
Christian

--
Christian Schulte, http://www.imit.kth.se/~schulte/ 

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Filip Konvicka
Sent: Monday, August 27, 2007 9:04 AM
To: users at gecode.org
Subject: [gecode-users] msvc 8.0 SP1 warning C4251


Hi,

simply including Gecode 1.3.1 headers (kernel.hh, int.hh, search.hh) 
caused the C4251 warning. Looking at the class definitions, I see the 
warning can be safely ignored, but it might still be worth wrapping the 
definitions in a
  #pragma warning(push) + #pragma warning(disable : 4251) + #pragma 
warning(pop)
block. BTW, did you consider using the pimpl idiom to hide the *Engine 
implementation classes? Why are the engine members "protected" and not 
"private", anyway? (Deriving from Gecode::Search::DFS would make this 
non-dll-export class accessible, wouldn't it?) I know that this is all a 
bit of hair-splitting.... :-)

Cheers,
Filip


1>c:\program files\gecode\include\gecode\search.hh(360) : warning C4251:
'Gecode::Search::DFS::e' : class 'Gecode::Search::DfsEngine' needs to 
have dll-interface to be used by clients of class 'Gecode::Search::DFS'
1>        c:\program files\gecode\include\gecode\search.hh(318) : see
declaration of 'Gecode::Search::DfsEngine'
1>c:\program files\gecode\include\gecode\search.hh(481) : warning C4251:
'Gecode::Search::LDS::e' : class 'Gecode::Search::ProbeEngine' needs to 
have dll-interface to be used by clients of class 'Gecode::Search::LDS'
1>        c:\program files\gecode\include\gecode\search.hh(428) : see
declaration of 'Gecode::Search::ProbeEngine'
1>c:\program files\gecode\include\gecode\search.hh(607) : warning C4251:
'Gecode::Search::BAB::e' : class 'Gecode::Search::BabEngine' needs to 
have dll-interface to be used by clients of class 'Gecode::Search::BAB'
1>        c:\program files\gecode\include\gecode\search.hh(543) : see
declaration of 'Gecode::Search::BabEngine'


_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list