-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/12/11 08:44, Alon Bar-Lev wrote:
> On Thu, Dec 8, 2011 at 2:13 AM, David Sommerseth <dav...@redhat.com>
> wrote:
>> +/* The POSIX access() function is called via _access() on Windows, 
>> + * defined in io.h + */ +#define HAVE_ACCESS 1 +#define access
>> _access +#pragma warning(disable : 4996) /* Avoid Visual Studio to
>> complain about access(), which is redefined */
> 
> Where is it defined? Anyway, won't it better: --- #ifdef access #undef
> access #endif #define access _access ---

I tried that approach as well, and I still got this warning:
- -------------------------------------------------------------------------
options.c(2619) : warning C4996: '_access': The POSIX name for this item
is deprecated. Instead, use the ISO C++ conformant name: _access. See
online help for details.
        c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\INCLUDE\io.h(185): see declaration of '_access'
options.c(2625) : warning C4996: '_access': The POSIX name for this item
is deprecated. Instead, use the ISO C++ conformant name: _access. See
online help for details.
        c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\INCLUDE\io.h(185): see declaration of '_access'
options.c(2629) : warning C4996: '_access': The POSIX name for this item
is deprecated. Instead, use the ISO C++ conformant name: _access. See
online help for details.
        c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\INCLUDE\io.h(185): see declaration of '_access'
options.c(2630) : warning C4996: '_access': The POSIX name for this item
is deprecated. Instead, use the ISO C++ conformant name: _access. See
online help for details.
        c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\INCLUDE\io.h(185): see declaration of '_access'
- -------------------------------------------------------------------------

In io.h:185, this line can be found:
- -------------------------------------------------------------------------
_Check_return_ _CRTIMP int __cdecl _access(_In_z_ const char * _Filename,
_In_ int _AccessMode);
- -------------------------------------------------------------------------

And access() is declared like this in io.h:303
- -------------------------------------------------------------------------
_Check_return_ _CRT_NONSTDC_DEPRECATE(_access) _CRTIMP int __cdecl
access(_In_z_ const char * _Filename, _In_ int _AccessMode);
- -------------------------------------------------------------------------

The only way around this warning was to use the #pragma declaration to
disable the C4996 warning.  But I'm no Visual Studio expert, I might have
overlooked something.


kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7glRwACgkQDC186MBRfrrM3QCgpgkDi4JWMaa4mmWjDeopDQfG
iWMAoKsMJC5zp4O9UwAwNtDXIM7wHkcB
=+4J5
-----END PGP SIGNATURE-----

Reply via email to