DOCGroup / ACE_TAO

ACE and TAO
https://www.dre.vanderbilt.edu/~schmidt/TAO.html
707 stars 381 forks source link

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

Open horusxnetworks opened 4 years ago

horusxnetworks commented 4 years ago

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

iguessthislldo commented 4 years ago

As a workaround for this, you can add:

#define ACE_DISABLE_MKTEMP
#define ACE_DISABLE_TEMPNAM

To your ace/config.h file.

jwillemsen commented 4 years ago

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