ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

warning: 'tempnam' is deprecated when building ACE for Android with NDK r21d

Open horusxnetworks opened this issue 3 years ago • 2 comments

Version

The version of ACE and/or TAO you are using 6.5.11

Host machine and operating system

Manjaro 20.0.1

Target machine and operating system (if different from host)

Android (armeabi-v7a, arm64-v8a, x86, x86_64)

Compiler name and version (including patch level)

Android NDK r21d

The $ACE_ROOT/ace/config.h file

#include "ace/config-android.h" If you use a link to a platform-specific file, simply state which one

The $ACE_ROOT/include/makeinclude/platform_macros.GNU file

include $(ACE_ROOT)/include/makeinclude/platform_android.GNU if you use a link to a platform-specific file, simply state which one (unless this isn't used in this case, e.g., with Microsoft Visual C++)

Contents of $ACE_ROOT/bin/MakeProjectCreator/config/default.features

Default

AREA/CLASS/EXAMPLE AFFECTED:

warning: 'tempnam' is deprecated: tempnam is unsafe, use mkstemp or tmpfile instead [-Wdeprecated-declarations]

The problem effects:

It affects compilation, linking.

Synopsis

Build ACE for Android with NDK r21d

Description

warning: 'tempnam' is deprecated: tempnam is unsafe, use mkstemp or tmpfile instead [-Wdeprecated-declarations]

Repeat by

N/A

Sample fix/ workaround

use mkstemp or tmpfile instead

horusxnetworks avatar Oct 27 '20 06:10 horusxnetworks

As a workaround for this, you can add:

#define ACE_DISABLE_MKTEMP
#define ACE_DISABLE_TEMPNAM

To your ace/config.h file.

iguessthislldo avatar Oct 27 '20 15:10 iguessthislldo

TAO_UIOP_Acceptor::open_default (see https://github.com/DOCGroup/ACE_TAO/blob/9ca0cfdade984635d126786b5496589741f50121/TAO/tao/Strategies/UIOP_Acceptor.cpp#L228) does use ACE_OS::tempnam, that will not work anymore when you disable tempnam, that code should be updated. A global search could show more places that need to be updated before we could disable ACE_OS::tempnam by default

jwillemsen avatar Oct 28 '20 18:10 jwillemsen