Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barrier.cpp fails compilation with ACE_HAS_DUMP defined in Visual Studio 2022. #2326

Open
bbronk01 opened this issue Feb 6, 2025 · 4 comments
Labels

Comments

@bbronk01
Copy link

bbronk01 commented Feb 6, 2025

All support on github is best effort only, no guarantees given. When you need guaranteed support have a look at the commercial support offerings as listed at https://github.com/DOCGroup/ACE_TAO/wiki/ACE-and-TAO-Commercial-support.

Version

The version of ACE and/or TAO you are using:
7.1.3, also present in latest github.

Host machine and operating system

Windows 11 23H2

Target machine and operating system (if different from host)

Compiler name and version (including patch level)

Visual Studio 2022 17.12.1

The $ACE_ROOT/ace/config.h file

#ifdef _DEBUG
#define ACE_HAS_DUMP 1
#endif
#define TAO_HAS_ZIOP 1
#ifndef wxHAS_MODE_T
#define wxHAS_MODE_T 1
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#define NTDDI_VERSION NTDDI_WIN7
#endif
#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#endif
#include "ace/config-win32.h"

If you use a link to a platform-specific file, simply state which one

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

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

Used by MPC when you generate your own makefiles

AREA/CLASS/EXAMPLE AFFECTED:

What example failed? What module failed to compile?
ace/Barrier.cpp

The problem effects:

Compilation with ACE_HAS_DUMP defined

Synopsis

Error:
H:\dev-vc14\3rdParty\ACE+TAO-7.1.3-VC16\ace\Barrier.cpp(28,3): error C4839: non-standard use of class 'std::atomic' as an argument to a variadic function [H:\dev-vc14\3rdParty\ACE+TAO-7.1.3-VC16\ace\ACE_vs2019.vcxproj]
H:\dev-vc14\3rdParty\ACE+TAO-7.1.3-VC16\ace\Barrier.cpp(28,3): error C2280: 'std::atomic::atomic(const std::atomic &)': attempting to reference a deleted function [H:\dev-vc14\3rdParty\ACE+TAO-7.1.3-VC16\ace\ACE_vs2019.vcxproj]

Description

Problem line
<snip line 28>
ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("running_threads_ = %d\n"), this->running_threads_));

running_threads_ was converted from an int to a std::atomic between 7.1.2 and 7.1.3. Atomic int's can't be passed to a variadic function without a cast.

Repeat by

Defining ACE_HAS_DUMP in config.h

Sample fix/ workaround

ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("running_threads_ = %d\n"), static_cast<int>(this->running_threads_)));

@jwillemsen
Copy link
Member

cast looks not a good fix

@jwillemsen jwillemsen added the bug label Feb 7, 2025
@mitza-oci
Copy link
Member

cast looks not a good fix

I think it's valid because it's a supported conversion in std::atomic https://en.cppreference.com/w/cpp/atomic/atomic/operator_T

@jwillemsen
Copy link
Member

I would like prefer the usage of load

@jwillemsen
Copy link
Member

Please open a pull request with a proposed fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants