Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: RE: EPICS V4 Windows build warning messages.
From: "Mark S. Engbretson" <Engbretson@anl.gov>
To: "'Johnson, Andrew N.'" <anj@aps.anl.gov>, <tech-talk@aps.anl.gov>
Date: Wed, 19 Apr 2017 15:42:20 -0500
Thank.

Although shouldn't this solution be merged into Epics base so that it goes
away for everyone in the future? 

Or

#ifdef _WIN32
#pragma warning disable C4251 
#endif

Put in pvaClient.h , which is the source of the code Microsoft doesn't like
. . . . 

. . . which would still warn people if they do something similar, and
actually more illegal somewhere else that you perhaps *don't* want to hide?

The linux builds of much of the Epics code compiles clean.  The window
compilers . . . . not so much so.

Again,thanks.


-----Original Message-----
From: Johnson, Andrew N. [mailto:anj@aps.anl.gov] 
Sent: Wednesday, April 19, 2017 2:58 PM
To: Engbretson, Mark S. <engbretson@aps.anl.gov>; tech-talk@aps.anl.gov
Subject: Re: EPICS V4 Windows build warning messages.

Hi Mark,

On 04/19/2017 01:41 PM, Mark S. Engbretson wrote:
> If one builds Epics V 4 on a windows box with Visual Studio 2013 
> Community, as either shared libraries or static, you get **hundreds** 
> of warning messages that deal with <something> needing to have 
> dll-interface to be used.
> 
> i.e.
> 
> warning C4251: 'epics::nt::NTEnum::URI' : class 
> 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'
> needs to have dll-interface to be used by clients of class 
> 'epics::nt::NTEnum'
> 
> Does anyone know if this is actually an indication that things will 
> most likely not work if, for example, one were to build AD2-6 with 
> Epics V4 support?

EPICS V4 built using MS Visual C++ works just fine, we do run the standard
self-tests on it before release.

This is a scary warning from Microsoft that is totally bogus. It's
suggesting that we need to modify classes inside the std:: namespace, which
of course we can't do (presumably MS could if it mattered since they provide
the definitions of their implementations of the C++ std classes; they
haven't applied the necessary decorations though, so presumably it doesn't
actually matter).

> Microsoft claims that the error is thrown when one is not separating 
> the interface from the implementation. If clients should not be able 
> to access these items, they should be made private and #pragma warning 
> disable C4251 added to source. If they should be accessible, code 
> added to access them.
> 
> I'm assuming the #pragma solution is a reasonable solution?

If you want to eliminate this particular warning completely you should be
able to do it in one place by adding this line to a suitable CONFIG_SITE
file:

  WARN_CXXFLAGS_YES += -w44251

Yes there are meant to be two '4' digits there. There is no need to rebuild
anything after making that change, all it does is suppress the
C4251 warning messages at build time; this compiler command-line option is
equivalent to the #pragma solution.

- Andrew

--
Arguing for surveillance because you have nothing to hide is no different
than making the claim, "I don't care about freedom of speech because I have
nothing to say." -- Edward Snowdon


Replies:
Re: EPICS V4 Windows build warning messages. Andrew Johnson
References:
EPICS V4 Windows build warning messages. Mark S. Engbretson

Navigate by Date:
Prev: Re: EPICS V4 Windows build warning messages. Andrew Johnson
Next: RE: EPICS V4 Windows build warning messages. Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: EPICS V4 Windows build warning messages. Andrew Johnson
Next: Re: EPICS V4 Windows build warning messages. Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 20 Apr 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·