Visual Studio 8 build warnings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Wishlist
|
Jeff Hill |
Bug Description
From Ken Evans
There are two sets of deprecated functions and an option reported as deprecated by Visual Studio 8. The issues seem to have been fixed by changing the following configuration files for 3.14.8.2 as described below:
configure/
config/
1. Many functions are now listed as possibly unsafe. (Because Microsoft has introduced new "secure" versions.) Define _CRT_SECURE_
xgif.c
../xgif.c(226) : warning C4996: 'strcpy' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\
Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_
2. The following option is reported as deprecated:
cl /GX /GR /nologo /D__STDC__=0 /Ox /W3 /DXMSTATIC /DMOTIFAPP /DWIN32
/D_WINDOWS /MD -I. -I.. -Ic:/Exceed/
-Ic:/Exceed/
-I../..
cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release cl : Command line warning D9036 : use 'EHsc' instead of 'GX' CGif.cpp
Note: /EHsc should work with MSVC 7, too.
3. There are others for which the POSIX name is deprecated Define _CRT_NONSTDC_
osdEnv.c
..\..\.
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\
: see declaration of 'putenv'
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _putenv. See online help for details.'
epicsTempFile.cpp
..\..\.
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _open. See online help for details.'
scan.l(682) : warning C4996: 'fileno' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _fileno. See online help for details.'
..\main.c(224) : warning C4996: 'unlink' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _unlink.
See online help for details.'
..\iocUtil.c(33) : warning C4996: 'chdir' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\
: see declaration of 'chdir'
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _chdir. See online help for details.'
..\iocUtil.c(44) : warning C4996: 'getcwd' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\
: see declaration of 'getcwd'
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getcwd. See online help for details.'
..\epicsStdioTe
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _fdopen. See online help for details.'
Original Mantis Bug: mantis-233
http://
I had to fix a few things to get R3.14.8 to compile with Visual Studio 8. At this time I only have an evaluation copy. I have the upgrade on order.
> ../xgif.c(226) : warning C4996: 'strcpy' was declared deprecated
> C:\Program Files\Microsoft Visual Studio
I have not yet investigated to see how common this is in base. Certainly, deprecating strcpy might have been a bit hasty on MS' part. Nevertheless, I consider strncpy to almost always be a better option. I haven't looked yet to see if that version is also deprecated.
My initial thought is that this is probably another foolish thing that MS has done, but nevertheless it might be best to investigate the situation prior to suppressing the warnings. The system builds fine as it is after all.
> cl : Command line warning D9035 : option 'GX' has been deprecated and will
> be removed in a future release
> cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
We could switch to EHsc, but I wonder if the VC 6 build will break :-(. I believe that it is currently ok).
> Message: 'The POSIX name for this item is deprecated. Instead, use
> the ISO C++ conformant name: _open. See online help for details.'
The problem here might be my using #include of ANSI C header files where C++ header files could be used. It might be best to investigate the situation prior to suppressing the warnings.